
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

February 14, 2006
program scopes (input, output ); var a : integer;
procedure first; begin a := 2; end;
procedure second; var a : integer; begin a:=5; first; write(a); end;
procedure third; var a: integer; begin a:=4; second; end;
begin a := 3; third; write(a); end.
Question: Consider the Pascal program above. Write the output of the program, assuming:
a) Static scope rules are in effect:
b) Dynamic scope rules are in effect: