Question: What does the above program print (or will the compiler identify static semantic errors), under the following assumptions: names must be declared before use, but

What does the above program print (or will the compiler identify static semantic errors), under the following assumptions:
- names must be declared before use, but the scope of a name is the entire block in which it is declared.
- names can be declared in any order and their scope is the entire block in which they are declared.
- names must be declared before use and the scope of a name extends from its declaration through the end of the block.
Consider the following pseudo code. 1. procedure main() 2. a: integer := 1 3. b: integer := 2 4. 5. procedure middle() b: integer := a 6. 7. procedure inner() print a, b 8. a: integer := 3 9. 10. 11. -- body of middle inner() print a, b 12. 13. 14. -- body of main middle() print a, b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
