Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int i,j,k = 1,expo = 2,num;
- float fat = 1, coss = 1;
- printf("Entre com o numero :\n");
- scanf("%d",&num);
- for (i = 1; i <= 40; i++)
- {
- for (j = expo; j > 0; j--)
- {
- fat = fat*j;
- }
- coss = coss + pow(-1,k)*pow(num,expo)/fat;
- k++;
- expo += 2;
- fat = 1;
- }
- printf("Resultado = %f\n",coss);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment