retagged by
5,664 views
6 votes
6 votes

Consider the following program in a language that has dynamic scooping:

var x: real;
procedure show:
    begin print(x);end;
procedure small;
    var x: real;
        begin x: = 0.125; show; end;
begin x:=0.25
    show; small
    end.

Then the output of the program is:

  1. 0.125 0.125
  2. 0.25 0.25
  3. 0.25 0.125
  4. 0.125 0.25
retagged by

2 Answers

Best answer
17 votes
17 votes
ans c)

In dynamic scoping, if a variable is not found in the local scope it is looked up on at the function from which the call is made.
selected by
Answer:

Related questions

6 votes
6 votes
2 answers
3
5 votes
5 votes
4 answers
4
Kathleen asked Sep 23, 2014
6,833 views
The number of tokens in the FORTRAN statement DO 10 I = 1.25 is345None of the above