Gate2001_2.19

Consider the following program

Program P2

var n:int:
procedure W(var x:int)
begin
x=x+1;
print x;
end

procedure D

begin
var n:int;
n=3;
W(n);
End
begin \\begin P2
n = 10;
D;
end

If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program?
(a) 10
(b) 11
(c) 3
(d) None of the above

Answer

Discuss

0Comment