Question: 2 . What is the output of following program using both Static and Dynamic scoping? begin integer x , y; function sub 1 ; begin

2. What is the output of following program using both Static and Dynamic scoping?
begin
integer x, y;
function sub1;
begin
print ("y in sub1=", y);
end;
function sub2(y: integer);
begin
print ("x in sub2=", x);
print ("y in sub2=", y);
sub1;
end;
sub2(2);
x: =10;
y: =5;
print ("y in main =", y);
sub1;
end;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!