Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- float pow=2, nr, dr=1, x1, sum=1, x;
- int i = 1,n,s = -1;
- printf("Introducir angulo (rad): \n");
- scanf("%f", &x);
- printf("Introducir numero entero para determinar la precision: \n");
- scanf("%d",&n);
- nr = x*x;
- while(i<=n)
- {
- dr = dr * pow * (pow - 1.0);
- sum = sum + (nr / (dr * s));
- s = s * (-1);
- pow = pow + 2.0;
- nr = nr * x * x;
- i++;
- }
- printf("THE SUM OF THE COS SERIES IS: %f", sum);
- return (EXIT_SUCCESS);
- }
Add Comment
Please, Sign In to add comment