Menu
Question Index
...

What will be the output of the following program?

class Output
{
    public static void main(String [] args)
    {
        int I = 0;
        outer:
            while (true)
            {
                I++;
                inner:
                    for (int i = 0; i < 10; i++)
                    {
                        I += i;
            
                        if (i == 0 || i == 1 || i == 2 || i == 3)
                            continue inner;
                        else
                            break outer;
                    }
                    continue inner;
            }
            System.out.println(I);
    }
}


4
11
0
10
Compilation error

Doubts

Problems

Topic: Using break In Nested Loop Java Program

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App