training

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

tab246.c (506B)


      1 /* Esercizio 3.26
      2  * 
      3  * Stampa una tabella di multipli di 2, 4 e 5
      4 */
      5 
      6 #include <stdio.h>
      7 
      8 int main()
      9 {
     10    int i=3;
     11 
     12    printf("A  A+2A+4A+6\n\n");
     13    while(i <= 15) {
     14       if (i == 3)
     15         printf("%d  %d  %d  %d\n", i, i+2, i+4, i+6);
     16       else if (i == 6)
     17         printf("%d  %d  %d %d\n", i, i+2, i+4, i+6);
     18       else if (i == 9)
     19          printf("%d  %d %d %d\n", i, i+2, i+4, i+6);
     20       else
     21          printf("%d %d %d %d\n", i, i+2, i+4, i+6);
     22       i += 3;
     23    }
     24 
     25    return 0;
     26 } /* E0F main */