Similar questions 3 more →
Functions & Parameter Passing

Answer & solution
Answer: D (no official key was published)
1. The function receives local copies a and b. Swapping those copies does not modify the caller’s x,y, so D.
2. A void function can modify caller objects through pointers, but this function’s parameters are int, not int*, and calling it with addresses does not repair its body.
3. Teaching check: Trace x=3,y=8: entry makes local a=3,b=8; the body leaves a=8,b=3, but x=3,y=8. A correct pointer-based version would take int *a,int *b and exchange *a,*b. A return value is not essential for that alternative.