write a program to find the sum of following series:- 1+x^2/3!+x^3/4!+x^4/5!+............+x^n/(n+1)!
1
Expert's answer
2013-07-16T11:36:16-0400
#include <iostream> #include <conio.h> #include <math.h> using namespace std; //find factorial double factorial(long n){ if (n < 1) return 0; double product = 1; for (int i = 1; i <= n; i++) product *= i; return product;//return result } //main function int main() { double x;//variable for x int sum=1;//variable for sum cout<<"Enter x: ";//enter x cin>>x;//read x for(int i=2;i<1000;i++){ sum+=pow(x,i)/(factorial(i+2));//find sum } //show result cout<<"Sum = "<<sum; getch();//delay return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment