while Loops

AP Computer Science A· difficulty 4/5

What does this print?

<code>for (int i = 0; i < 5; i++) { if (i == 2) continue; System.out.print(i); } </code></pre>

  • A

    0134

    check_circle
  • B

    0234

  • C

    01

  • D

    01234

Explanation

Skip print when i=2 → 0, 1, 3, 4.

Want 10 more like this — adaptive to your weak spots?

Related questions