Question #43137
1 - u + u^3/2! - u^5/3! + ... + (-1)^(2n-1) u^(2n-1)/n!
1
Expert's answer
2014-06-12T11:16:30-0400
#include <iostream>#include <math.h>#include <conio.h>using namespace std;int main(){    int n;    double u;    cout<<"n = ";    cin>>n;    cout<<"u = ";    cin>>u;    double sum = 1.0;    double value = u;    for (int i = 1; i <= n; ){        sum += pow(-1.0, (double)i)*value;        value *= u*u/(++i);    }        cout<<"answer = "<<sum<<endl;    getch();    return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS