c# do while code example
Example 1: while loop in c#
int i = 0;
while (i < 10)
{
Console.WriteLine("Value of i: {0}", i);
i++;
}
Example 2: c# while loop
int n = 0;
while (n < 5)
{
Console.WriteLine(n);
n++;
}
Example 3: c# do while
do
{
//Code here (will run at least once)
} while (true); //Condition to test for here