1 votes 1 votes Consider the following program: #include<stdio.h> main() { int i, inp; float x, term=1, sum=0; scanf("%d %f", &inp, &x); for(i=1;i<=inp;i++) { term=term*x/i; sum=sum+term; } printf("Result=%f\n", sum); } The program computes the sum of which of the following series? $x+x^2/2+x^3/3+x^4/4 + \dots$ $x+x^2/2!+x^3/3!+x^4/4! + \dots$ $1+x^2/2+x^3/3+x^4/4 + \dots$ $1+x^2/2!+x^3/3!+x^4/4! + \dots$ Programming and DS ugcnetcse-dec2015-paper2 programming-in-c + – go_editor asked Aug 8, 2016 recategorized Nov 8, 2021 by soujanyareddy13 go_editor 1.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes i=1 ,term =1 , term=1*x/1, sum=0+x/1 i=2, term=x , term =x*x/2, sum=x+x^2/2 i=3 term=x^/2 , term =x^3/6, sum =x+x^2/2+x^3/6 and do on which is better shown by x/1!+x^2/2! +x^/3!+.... so ans is B Sanjay Sharma answered Aug 8, 2016 Sanjay Sharma comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes B is answer. $x+ x^{2}/2! + x^{^{3}}/3! + x^{4}/4!.....$ Prashant. answered Aug 8, 2016 edited Aug 8, 2016 by Prashant. Prashant. comment Share Follow See all 3 Comments See all 3 3 Comments reply Sanjay Sharma commented Aug 8, 2016 reply Follow Share why not b 0 votes 0 votes Prashant. commented Aug 8, 2016 reply Follow Share because term=term*x/i; make evry tme multiple x in numerator and i+1 in denomerator. for i= 1= 1 * x/1= x for i= 2= x * x/2= $\frac{x^{2}}{2!}$ like this 0 votes 0 votes Sanjay Sharma commented Aug 8, 2016 reply Follow Share actually i was referring B not A edited 0 votes 0 votes Please log in or register to add a comment.