int i = 1;
while(i != 0)
{
//This code will loop
Console.WriteLine("Say a number");
i = int.Parse(Console.ReadLine());
}
while(condition)
{
statement(s);
}
_______________EX.___________________
int a = 0;
while (a < 10)
{
Console.WriteLine(a); //output>> 0 .. 1 .. 2 ........ 8 .. 9
a++;
}
while (true)//the "true" keyword mean it will run forever, you can change it too (example while (i > 3))
{
//Code here
System.Threading.Thread.Sleep(100) // Convertion: 1000 = 1 second
//if you are using a while true statment, your program will frezze without this Sleep keyword
}
int i = 0;
while (i < 20)
{
Console.WriteLine(i);
i++;
}