nikolas_serafini

Lista 3 - Exercício 68

Jun 17th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. int main()
  2. {
  3.     int i,j,number,cycle,fat = 1;
  4.  
  5.     printf("Entre com o numero de valores a serem lidos :\n");
  6.     scanf("%d",&cycle);
  7.  
  8.     for (i = 0; i < cycle; i++)
  9.     {
  10.         printf("Entre com um valor inteiro e positivo :\n");
  11.         scanf("%d",&number);
  12.  
  13.         for (j = number; j > 0; j--)
  14.         {
  15.             fat = fat*j;
  16.         }
  17.         printf("VALOR = %d\nFATORIAL = %d\n",number,fat);
  18.         fat = 1;
  19.     }
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment