What does this print?
<code>for (int i = 1; i <= 2; i++) for (int j = 1; j <= 3; j++) System.out.print(i*j + " "); </code></pre>
- A
1 2 3 4 5 6
- B
1 2 3 1 2 3
- Ccheck_circle
1 2 3 2 4 6
- D
1 4 9
Explanation
i=1: j=1,2,3 → 1 2 3; i=2: j=1,2,3 → 2 4 6.
AP Computer Science A· difficulty 4/5
What does this print?
<code>for (int i = 1; i <= 2; i++) for (int j = 1; j <= 3; j++) System.out.print(i*j + " "); </code></pre>
1 2 3 4 5 6
1 2 3 1 2 3
1 2 3 2 4 6
1 4 9
Explanation
i=1: j=1,2,3 → 1 2 3; i=2: j=1,2,3 → 2 4 6.
Want 10 more like this — adaptive to your weak spots?