Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float angle,num = 1, fat = 2, coss = 1;
- int i,j = 2, k = 3, sinal = 1,terms;
- printf("Entre com o angulo :\n");
- scanf("%f",&angle);
- printf("Entre com a quantidade de termos da serie :\n");
- scanf("%d",&terms);
- for (i = 1; i <= terms; i++) {
- sinal = (-1)*sinal;
- num = num*angle*angle;
- coss = coss + (sinal*num)/fat;
- fat = fat*(i+j)*(i+k);
- j++;
- k++;
- }
- printf("O cosseno eh : %f\n",coss);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment