Question: What is the output of following program using both Static and Dynamic scoping begin integer x, y; function sub1; begin print (y in subl-y) end;
What is the output of following program using both Static and Dynamic scoping begin integer x, y; function sub1; begin print ("y in subl-y) end; function sub2 (y: integer): begin print ("z in sub2-", x); print ("y in sub2 ", y): sub1; end; x: 10; y: # 5; print sub2(1) subl; ("y in main ",y); end; Output: Static Scoping Dynamic Scoping
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
