Gate CS-2014-2 Question Paper With Solutions

Q. 50 Consider the following function

double f(double x){
  if (abs(x*x - 3) < 0.01) return x;
  else return f(x/2 + 1.5/x);
}

Give a value q (to 2 decimals) such that f(q) will return q:_____.

(A) 1.73

(B) 2.24

(C) 4.22

(D) 3.42

Answer: (A)

Explanation:

Gate CS-2014-2 Question Paper With Solutions Gate CS-2014-2 Question Paper With Solutions

Learn More:   Gate EE-2004 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here