Multiple choice

What would be the output of the following program? #include<stdio.h> #include<conio.h> #include<math.h> int main() { int f=1,l,i,x=4,y=6; float jam; jam=x; for(i=2;i<=y;i+=2) { f=1; for(l=1;l<=i;l++) f=f*l; jam=jam+pow(x,i)/f; } printf(result is %f,jam); getch(); }

  1. 22.355555

  2. 28.055555

  3. 28.655555

  4. 22.655555

  5. 28.355555

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

The program will evaluate the series as X + X2 / 2! + X4 / 4! + X6 / 6! + .................... Xn / n! So, putting values of x and y in program, the result will be 28.355555. Hence, option (5) is correct.