Difficulty: Easy
Correct Answer: 0 0 34 34
Explanation:
Introduction / Context:
This output-tracing problem checks your ability to follow nested for loops, compute assigned values, and notice that the formula depends only on i, not j. The array is 2×2, and values are printed as they are assigned.
Given Data / Assumptions:
Concept / Approach:
Compute per row: for i = 0, all entries are 0; for i = 1, all entries are 34. The inner loop prints each assignment immediately, so the sequence is row 0 values, then row 1 values.
Step-by-Step Solution:
Verification / Alternative check:
Note that j does not appear in the right-hand side, so columns within a row are identical.
Why Other Options Are Wrong:
They use 17s, all zeros, or reverse ordering that does not match the loop progression.
Common Pitfalls:
Accidentally using i * 17 + j * 17, or assuming row-major printing reverses order (it does not here).
Final Answer:
0 0 34 34
Discussion & Comments