Using (Dynamic scoping)
procedure Main is
X, Y, Z : Integer;
procedure Suba is
A, Y, X : Integer;
begin
-- Suba body
end;
procedure Subb is
A, B, Z : Integer;
begin
-- Subb body
end;
procedure Subc
A, X, W : Integer;
begin
--- Subc body
end;
begin
--- Main body
end;
The question is: For the calling sequence, state which variables are visible during the execution of the last procedure Main calls Suba; Suba calls Subb; Subb calls Subc
Why is the answer: Suba: A, X, W Subb: B, Z Subc: Y
I tried working through it and I just don't see how that is the answer can anyone provide an explanation