Question 6921 – UGC NET CS 2015 Dec – paper-3
April 14, 2024Question 10421 – Programming
April 14, 2024Programming
|
Question 46
|
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
The value of n, output by the program PARAM is:
|
0, because n is the actual parameter corresponding to x in procedure Q.
|
|
|
0, because n is the actual parameter to y in procedure Q.
|
|
|
1, because n is the actual parameter corresponding to x in procedure Q.
|
|
|
1, because n is the actual parameter corresponding to y in procedure Q.
|
|
|
none of the above
|
Question 46 Explanation:
0, because n is just passed to formal parameters of Q and no modification in global n.
Correct Answer: E
Question 46 Explanation:
0, because n is just passed to formal parameters of Q and no modification in global n.
