Intro of JAVA
Learn Java
While loop also iterate program number of times but iteration is not fixed.It test condition before execution of loop body.
Syntax:
while(condition){
//code to be executed
}
Class Abc{
public static void main(String args[]){
int i=0;
//while code
while(i<=10){
System.out.println(i);
i++;}
}
}
Output