Algorithms | Misc | Question 7

Last Updated :
Discuss
Comments
Consider the following C function. c
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 (GATE CS 2003)
x^y
e^x
ln(1 + x)
x^x
Share your thoughts in the comments