Similar questions 5 more →
Scope, Lifetime & Storage Classes

Your answer
Answer & solution
Answer: A (no official key was published)
Step 1: A static local is initialized once and retains its value between calls. The successive arguments are 0,1,2,3,4.
Step 2: The retained count becomes 0,1,3,6,10. Each returned value is assigned to j, so the final assignment stores 10.
Thus A. Reinitializing count on every call would incorrectly yield 4; stopping the loop before i=4 would yield 6, but the printed condition is inclusive.