...
2005 Dec UGC NET Paper-1
February 13, 2024
Programming
February 13, 2024
2005 Dec UGC NET Paper-1
February 13, 2024
Programming
February 13, 2024

Programming

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 
A
2
B
√2
C
Run time error
D
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.
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.

Leave a Reply

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