(25 points) Given the code fragment and output below, which of
the five parameter passing mechanisms will produce the output?
(there may be more than one). Defend your answer. The code
fragment is assumed to be in a block-structured language with static
scoping, like Pascal (but not Pascal).
program quiz;
var i : integer;
A : array [1..200] of integer;
procedure foo(x,y);
begin
i := x+y;
end;
begin (* of main program *)
i := 2;
A[i] := 99;
foo(i, A[i]);
print (i);
print (A[i]);
end.
The output:
2
99