What is do-while:
The do/while loop is a variant of the while loop. This loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.
Syntax in do-while:
do{
//code to be executed / loop body
//update statement
}while (condition);
Flowchart of do-while loop:

Example program:
| public class Do { public static void main(String[] args) { int no = 20; do { System.out.println(no); no++; }while(no<=25); //2<=5 } } |
Output:
