/* Program to find out the sum of 1 + x + (x ^2)/2! +.....10 terms series */ /* Problem 13 */ #include #include #include int fact(int n) { if (n == 1) return 1; else return (n * fact(n-1)); } main() { int x,i; float sum; clrscr(); printf("Enter the value of x : "); scanf("%d",&x); sum = 1.0; for (i = 1; i <= 9; i++) sum += pow(x,i) / fact(i); printf("\nThe sum of the series for x=%d is %f",x,sum); printf("\n\nPress any key to exit..."); getch(); }