Answered step by step
Verified Expert Solution
Question
1 Approved Answer
13. (6pts) Given the following: x:lnteger, procedure Sub1 is procedure Main is begin of sub1 end: -- of Sub1 procedure Sub2 is x: Integer; begin
13. (6pts) Given the following: x:lnteger, procedure Sub1 is procedure Main is begin of sub1 end: -- of Sub1 procedure Sub2 is x: Integer; begin of Sub2 x:- 10; Sub1 end-of Sub2 begin - of Main x:- 5; Sub2 End of Main a) Assume static scoping. What value of x is printed in procedure Sub1? 5 b) Now repeat assuming dynamic scoping main sub2- sub1 put(x)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started