Output of the Program if Static scoping is used ?

0

1 int x;
2 Q(int z){
3 z += x;
4 }
5
6 P(int y){
7 int x;
8 x = y + 3;
9 Q(x);
10 print(x);
11 }
12
13 main(){
14 x = 3;
15 P(x);
16 Q(x);
17 print(x);
18 }
What will be the output of the program if static scoping is used?
(1) 9, 6 (2) 3, 18 (3) 3, 6 (4) 9, 18

Ravi Garg edited question
    0
    Sonali Kapoor (anonymous)

    its 6,3

    Sonali Kapoor answered
      Add image to editor add image from link

      Question stats

      • Active
      • Views189 times
      • Answers1 answer
      • Followers1 follower
      Question and answer is powered by AnsPress