Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int n;
- float Z, x, A;
- n = 1;
- x = 0.2;
- Z = 0;
- A = ((pow((1+ x), (2* n))) / n) * pow(-1, n);
- do
- {
- Z += A;
- n++;
- A = ((pow((1 + x), (2 * n))) / n) * pow(-1, n);
- }
- while (fabs(A) > 1 / 10000.);
- printf("%f", Z);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement