Menu
Question Index
...

What will be output of the following program?

class DoWhile
{
    public static void main(String s[])
    {
        int n = 5;

        do
        {
            System.out.println("n = " + n);
            n--;
        } while ( n < 2 );

    }
}


n = 5
n = 4
n = 3
n = 2
n = 1
n = 5
n = 4
n = 3
n = 5
Compilation errors

Doubts

Problems

Topic: do while Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App