Menu
Question Index
...

What will be output of the following program?

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

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

    }
}


n = 3
n = 2
n = 1
n = 3
n = 2
n = 1
n = 0
n = 3
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