While Loop
using System;
//Statements inside any while loop are executed until the given condition is true.
public class Iteration
{
static void Main(String[] args)
{
int i = 0;
while (i < 5) // Executes until i<5
{
Console.WriteLine("Value = " + i);
i++;
}
Console.ReadLine();
}
}
Output:
Value = 0
Value = 1
Value = 2
Value = 3
Value = 4