Functions & Parameter Passing

Answer & solution
Official answer: 26 to26
Our answer: 26
Method: keep the function's local parameter names separate from the caller's variables, and evaluate statements in sequence.
1. Initially main has (x,y)=(2,5). In y=jumble(y,x), the first argument is main's y=5 and the second is main's x=2. Inside the function, local (x,y) therefore starts as (5,2).
2. The function computes local x=2×5+2=12 and returns 12. C passes these integers by value, so changing the local x does not alter main's x. The assignment updates only main's y, leaving main at (2,12).
3. The second call, x=jumble(y,x), now passes (12,2). The returned value is 2×12+2=26, and the enclosing assignment stores it in main's x.
4. Main is now (26,12), so printing x displays 26. Reusing the function's parameter name x does not make it an alias of the caller's x.
Result: 26. The official range 26 to 26 accepts this exact value.