Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main (){
- int n;
- float s=0;
- float a;
- float x;
- cout <<"x,n";cin>> x >> n ;
- a=x;
- s=s+a;
- for (int i=2 ; i<=n ;i++)
- {
- a=-(x*x)/(2*(2*i-1)*(i-1));
- s=s+a;
- }
- cout<<s<<endl ;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement