Programming
April 14, 2024
Question 6922 – UGC NET CS 2015 Dec – paper-3
April 14, 2024
Programming
April 14, 2024
Question 6922 – UGC NET CS 2015 Dec – paper-3
April 14, 2024

Question 10421 – Programming

Program PARAM (input, output);
 var m, n : integer;
 procedure P (var, x, y : integer);
    var m : integer;
    begin
      m : = 1;
      x : = y + 1
    end;
 procedure Q (x:integer; vary : integer);
    begin
      x:=y+1;
    end;
 begin
    m:=0; P(m,m); write (m);
    n:=0; Q(n*1,n); write (n)
 end 

What is the scope of m declared in the main program?

Correct Answer: A

Question 47 Explanation: 
Since m is defined global it is visible inside all the procedures.
A
PARAM, P, Q
B
PARAM, P
C
PARAM, Q
D
P, Q
E
none of the above

Leave a Reply

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