Guest User

Untitled

a guest
Jan 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char** argv)
  7. {
  8. double x,rezult;
  9. int i,n;
  10. cout<<"Enter x -> fabs(x)<1 ";
  11. cin>>x;
  12. cout<<"Enter n ";
  13. cin>>n;
  14. rezult=0;
  15. for(i=1;i<=n;i++)
  16. rezult+=pow(-1,i-1)*pow(x,i)/i;
  17.  
  18. cout.precision(6);
  19. cout<<"ln(1+x)="<<rezult;
  20. return 0;
  21. system("pause");
  22. }
Add Comment
Please, Sign In to add comment