2005 Dec UGC NET Paper-1
February 13, 2024Programming
February 13, 2024Programming
|
Question 8
|
What is the value of X printed by the following program?
program COMPUTE (input, output);
var
X:integer;
procedure FIND (X:real);
begin
X:=sqrt(X);
end;
begin
X:=2
Find(X)
Writeln(X)
end
|
2
|
|
|
√2
|
|
|
Run time error
|
|
|
None of the above
|
Question 8 Explanation:
Since nothing is said in question. So we will assume by default call by value.
X in the procedure FIND is a local variable. No change will be reflected in global variable X.
X in the procedure FIND is a local variable. No change will be reflected in global variable X.
Correct Answer: C
Question 8 Explanation:
Since nothing is said in question. So we will assume by default call by value.
X in the procedure FIND is a local variable. No change will be reflected in global variable X.
X in the procedure FIND is a local variable. No change will be reflected in global variable X.
