While Loop Example
public class WhileLoop {
public static void main(String[] args) {
int i=0;
while(i<5){
System.out.println("Value= "+i);
i++;
}
}
}
Output:
Value= 0
Value= 1
Value= 2
Value= 3
Value= 4