Similar questions 2 more →
Runtime Environments & Parameter Passing


Answer & solution
Answer: D: 1 because x and y both reference the global m (no official key was published)
Both formal reference parameters bind to the caller’s global m. The procedure’s separate local variable named m shadows the global name only for direct uses of that identifier in P; setting it to one does not change the caller’s m. Then x:=y+1 reads global m=0 through y and stores one through x. Consequently the global m printed by the caller is one. The result is not caused by the local m assignment, so the option giving that incorrect reason is not selected.