Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //#include <math.h>
- double main_arctg(float x, float eps)
- {
- int n;
- n=1;
- double y=0.0;
- float c=x;
- while(fabs(c)>eps)
- {
- c=-c*x*x*x*x*(2*n-1)/(2*n+1);
- y=y+c;
- n++;
- }
- return x*y - 1;
- }
- int main()
- {
- float x,eps,y;
- printf ("vvesti x,eps\n");
- scanf("%f%f",&x,&eps);
- printf("--------------------\n");
- printf("| x | y | n |\n");
- printf("--------------------\n");
- y=main_arctg(x,eps);
- printf("\n| %7.4f | %7.4f | %7.4f\n",x,y,eps);
- printf("-----------------\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement