Do While Loop Example
public class DoWhileLoop {
public static void main(String[] args)
{
int i=0;
do{
System.out.println("Value = "+i); //statements inside any do-while loop are executed atleast once
i++;
}while(i<5);
}
}
Output:
Value = 0
Value = 1
Value = 2
Value = 3
Value = 4