Multiple choice technology programming languages

What all gets printed when the following code is compiled and run? Select the three correct answers. public class xyz { public static void main(String args[]) { for(int i = 0; i < 2; i++) { for(int j = 2; j>= 0; j--) { if(i == j) break; System.out.println("i=" + i + " j="+j); } } } }

  1. i=0 j=0

  2. i=0 j=1

  3. i=0 j=2

  4. i=1 j=0

  5. i=1 j=1

  6. i=1 j=2

Reveal answer Fill a bubble to check yourself
B,C,F Correct answer
Explanation

Tracing the loops: When i=0, j prints 2,1 before break at j=0. When i=1, j prints 2 before break at j=1. When i=2, j prints 2,1,0 but i=2 after loop ends. Output: i=0 j=2, i=0 j=1, i=1 j=2.