how to loop with while in c# code example
Example 1: c# while loop
while(condition)
{
statement(s);
}
_______________EX.___________________
int a = 0;
while (a < 10)
{
Console.WriteLine(a); //output>> 0 .. 1 .. 2 ........ 8 .. 9
a++;
}
Example 2: c# do while
do
{
//Code here (will run at least once)
} while (true); //Condition to test for here