Functions & Parameter Passing

Answer & solution
Official answer: A
Step through it (13 steps)
Approach: Separate the calls that evaluate arguments from the calls inside f.
1. Derivation. Using the stipulated right-to-left argument evaluation, h(20) prints 20, then g(10) prints 10. Their return values bind x=10, y=20 in f. Its sequential statements then print10 and 20. With no separators the output is 20101020, option A. Right-to-left evaluation is an explicit premise here, not a portable C-language guarantee.
2. Explanation and checks. The event trace is h(20): print 20, return 20; g(10): print 10, return 10; enter f with x=10,y=20; g(x): print 10; h(y): print 20. Reversing evaluation order does not swap the formal parameters: the first argument still supplies x. The explicit right-to-left assumption applies to evaluating the argument expressions, not to reversing the two statements in the body of f.