Question: Note: Attempt any four questions; each question carry equal marks. Question#2 5+ Marks 10 2(a) Consider the program written in a hypothetical programming language
Note: Attempt any four questions; each question carry equal marks. Question#2 5+ Marks 10 2(a) Consider the program written in a hypothetical programming language which allows global variables and a choice of static or dynamic scoping. Let i be variable declared multiple times in different scopes. What will be the i value printed under static scoping and what will be the i value printed under dynamic (scoping. (2) Int i; Program main(){ i = 10; Call f(); } Procedure f() Int i =20; Call g (); Procedure g(){ } Print i; } 2(b) Give the short circuit evaluation of the following program 2 (a). Statice sloping to 120 (5) (3)
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
The provided image displays a programming question that asks the impact of static and dynamic scopin... View full answer
Get step-by-step solutions from verified subject matter experts
