nikolas_serafini

Lista 3 - Exercício 57

Jun 16th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int i,j,k = 1,expo = 2,num;
  7.     float fat = 1, coss = 1;
  8.  
  9.     printf("Entre com o numero :\n");
  10.     scanf("%d",&num);
  11.     for (i = 1; i <= 40; i++)
  12.     {
  13.         for (j = expo; j > 0; j--)
  14.         {
  15.             fat = fat*j;
  16.         }
  17.         coss = coss + pow(-1,k)*pow(num,expo)/fat;
  18.         k++;
  19.         expo += 2;
  20.         fat = 1;
  21.     }
  22.    
  23.     printf("Resultado = %f\n",coss);
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment