...
Programming
February 13, 2024
Programming
February 13, 2024
Programming
February 13, 2024
Programming
February 13, 2024

Programming

Question 5

Consider the program below:

 Program main;
    var r:integer;
    procedure two;
    begin write (r) end;
    procedure one;
    var r:integer;
    begin r:=5 two; end begin r:=2;
    two; one; two;
    end. 

What is printed by the above program if
(i) Static scoping is assumed for all variables;
(ii) Dynamic scoping is assumed for all variables.
Give reasons for your answer.

A
Theory Explanation.
Correct Answer: A

Leave a Reply

Your email address will not be published. Required fields are marked *