training

Code I wrote during training
git clone git://git.bitsmanent.org/training
Log | Files | Refs | README

fatt15tab.c (320B)


      1 /* Esercizio 4.14 */
      2 
      3 #include <stdio.h>
      4 
      5 int main()
      6 {
      7    int c_val, i; /* contatori */
      8    int fatt = 1; /* Fattoriale */
      9 
     10    for (i = 1; i <= 5; ++i) {
     11      for (c_val = i; c_val >= 1; --c_val) {
     12          fatt *= c_val;
     13       }
     14       printf("%d! = %d\n", i, fatt); 
     15       fatt = 1;
     16    }
     17 
     18    return 0;
     19 } /* E0F main */
     20