1,196 views
3 votes
3 votes
What is S1,S2?and how to to decide their scope for variable access?

Procedure A;
  x,y:intger;
   Procedure B;
    x,z:real
    S1
   end B;
   Procedure C;
      i:integer;
       S2
   end C;
end A;

The variables accessible in S1 and S2 are
(A) x of A, y, x of B and z in S1 and x of B, y and i in S2
(B) x of B, y and z in S1 and x of B, i and z in S2
(C) x of B, z and y in S1 and x of A, i and y in S2
(D) None of the above

1 Answer

0 votes
0 votes
Option C

S1--> x  and z of B and  y of A accessible here but due to ambiguity  x of A can't be access

S2-->x and y of A  and i of C  can be access here

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
2 answers
3
Mizuki asked Nov 1, 2018
664 views
What does it mean when they say "An array A[1...n] consists of a permutation of numbers 1....n.".?Also I'd be grateful if you give some example.
0 votes
0 votes
0 answers
4
Ram Swaroop asked Jan 3, 2019
654 views
Which of the following functions describe the graph shown in the below figure? (A) y=||x|+1|−2(B) y=||x|−1|−1(C) y=||x|+1|−1(D) y=||x|−1|−1|