Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define PI 3.14159265359
- void main()
- {
- int i, n;
- float x, sum, t;
- printf(" Enter the value for x : ");
- scanf("%f",&x);
- printf(" Enter the value for n : ");
- scanf("%d",&n);
- x=x*PI/180;
- t=x;
- sum=x;
- for(i=1;i<=n;i++)
- {
- t=(t*(-1)*x*x)/(2*i*(2*i+1));
- sum=sum+t;
- }
- printf(" The value of Sin(%f) = %.3f",x,sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement