Consider the following C function. float f(float x, int y) { float p, s; int…

PYQ GATE 2003

Consider the following C function. 

float f(float x, int y)
{
  float p, s; int i;
  for (s=1, p=1, i=1; i < y; i ++)
  {
    p*= x/i;
    s+=p;
  }
  return s;
}  

For large values of y, the return value of the function f best approximates

  1. A.

    x^y

  2. B.

    e^x

  3. C.

    ln(1 + x)

  4. D.

    x^x

Attempted by 139 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…