Programming
April 14, 2024Question 6922 – UGC NET CS 2015 Dec – paper-3
April 14, 2024Question 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.
PARAM, P, Q
PARAM, P
PARAM, Q
P, Q
none of the above
