Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BÀI 20:
- #include <stdio.h>
- #include <conio.h>
- #include <math.h>
- main ()
- {
- int i=1; float c,sinx,S,x;
- printf ("Nhap c:"); scanf ("%f",&c);
- printf ("\nNhap x:"); scanf ("%f",&x);
- S=x;sinx=x;
- do
- {
- S*=S*x*x/((2*i)*(2*i+1));
- if (i%2==0) sinx+=S;
- else sinx-=S;
- i++;
- }
- while (fabs(S)>c);
- printf ("sinx=%f",sinx);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment