Indicate the result of the following program if the language uses (i) static…

PYQ GATE 1989

Indicate the result of the following program if the language uses (i) static scope rules and (ii) dynamic scope rules.

var x, y:integer;
procedure A (var z:integer);
var x:integer;
begin x:=1; B; z:= x end;
procedure B;
begin x:=x+1 end;
begin
x:=5; A(y); write (y)
...end.

Sign up free to check your answer

Sign up free

Explore the full course: Compiler Design

Loading lesson…