Menu
Question Index
...

What will be the output of the following program?

public class Question {
    public static void main(String args[]) {
        int x, y, k;
        y = 3;
        label : for (x = 0; x < y; x++) {
            for (k = 0; k < 2; k++) {
                if (x == k) {
                    continue label;
                }
                System.out.print(x + "~" + k + " ");
            }
        }
    }
}


(EMPTY)
1~0
1~0 2~0
1~0 2~0 2~1
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java for loops vs Java while loops vs Java do while loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App