Question: Consider the following pseudocode. Suppose this was code for a language with the declaration, that is, names must be declared before use, and the scope

Consider the following pseudocode. Suppose this was code for a language

with the declaration, that is, names must be declared before use, and the scope of a name

extends from its declaration through the end of the block. What does this program print

if the language uses static scoping? What does it print with dynamic scoping? Why?

Consider the following pseudocode. Suppose this was code for a language with

1. procedure main 2 3 a : integer := 1 b: integer 2 4 5. procedure middle b: integer :- a 6. 7 procedure inner print a, b 8 a : integer 3 body of middle inner() print a, b 10 12 13. middle () 14. print a, b body of main

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!