Consider the following Pascal function: function X (M:integer) : integer; var…
GATE · 1991 · CS · Question 3 subpartsModified — slightly modified from the official paper; see the solution
Consider the following Pascal function:
function X (M:integer) : integer;
var i:integer;
begin
i:=0;
while i*i<M do i:=i+1
X:=i;
end
The function call X(N), if N is a positive integer that is not a perfect square, will return
- A.
(√N)
- B.
(√N)+1
- C.
[√N]
- D.
[√N]+1
- E.
None of the above
Attempted by 25 students.
Sign up free to check your answer
Sign up freeLoading lesson…