Menu
Question Index
...

What will be the output of the following program?

public class DoingWhile {
    public static void main(String[] args) {
        int i = 18;
        System.out.print('a');
        outer : while (3 < 4) {
            System.out.print('b');
            do {
                System.out.print('c');
                if (i++ > 20)
                    break outer;
                if (1 < 2)
                    break;
                System.out.print('d');
            } while (6 > 7);
            System.out.print('e');
        }
        System.out.print('f');
    }
}


ababbabbabbaf
abcebcebcebcf
abecbecbecbef
Some other output
Compilation Error or Runtime 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