Java-Do While Loop

Do While Loop

The do-while loop always executes its body at least once, because its conditional expression is at the bottom of the loop. Its general form is :

The do-while loop first executes the body of the loop and then evaluates the conditional expression. If this expression is true, the loop will repeat. Otherwise, the loop terminates.


Program Source

class Javaapp {

    public static void main(String[] args) {
        int i=0;
            System.out.println("Value of i = "+i);

Leave a Comment