What is printed?
<code>int i = 0; while (i < 3) { System.out.print(i + " "); i++; } </code></pre>
- A
1 2 3
- B
Infinite loop
- C
0 1 2 3
- Dcheck_circle
0 1 2
Explanation
Loops while i < 3: prints 0, 1, 2.
AP Computer Science A· difficulty 2/5
What is printed?
<code>int i = 0; while (i < 3) { System.out.print(i + " "); i++; } </code></pre>
1 2 3
Infinite loop
0 1 2 3
0 1 2
Explanation
Loops while i < 3: prints 0, 1, 2.
Want 10 more like this — adaptive to your weak spots?