Difficulty: Medium
Correct Answer: 3, 2, 15
Explanation:
Introduction / Context:
This question targets operator side effects: pre-increment (++x) vs post-increment (x++), and how these changes alter subsequent indexing into an array.
Given Data / Assumptions:
Concept / Approach:
Pre-increment changes the variable then yields the incremented value. Post-increment yields the current value, then increments it. Also, using i++ as an index uses the old i for access and increments afterward.
Step-by-Step Solution:
Verification / Alternative check:
Trace with a quick table of i and a[1] across each statement; results remain consistent with pre/post rules.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting that i++ uses the old i for indexing before incrementing, and mixing up pre vs post effects on a[1].
Final Answer:
3, 2, 15
Discussion & Comments