Advertisement
u53r

Calcolo tabelline da 1 a 10

Jan 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.37 KB | None | 0 0
  1. /*
  2. Calcolo delle tabelline da 1 a 10
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. int main() {
  8.   int tab[11][11]; // Array per memorizzare i valori
  9.   int num,fatt; // num = numero della tabellina; fatt = numero per cui moltiplicare num. Es. se num = 5 e fatt = 7, allora num*fatt = 35
  10.   for (num=1;num<=10;num++) {
  11.     if (num == 1) {
  12.       printf("--------------- TABELLINA DELL\' UNO -------------\n");
  13.     }else if(num == 2){
  14.       printf("--------------- TABELLINA DEL DUE -------------\n");
  15.     }else if (num == 3) {
  16.       printf("--------------- TABELLINA DEL TRE -------------\n");
  17.     }else if(num == 4){
  18.       printf("--------------- TABELLINA DEL QUATTRO -------------\n");
  19.     }else if (num == 5) {
  20.       printf("--------------- TABELLINA DEL CINQUE -------------\n");
  21.     }else if(num == 6){
  22.       printf("--------------- TABELLINA DEL SEI -------------\n");
  23.     }else if(num == 7){
  24.       printf("--------------- TABELLINA DEL SETTE -------------\n");
  25.     }else if (num == 8) {
  26.       printf("--------------- TABELLINA DELL\' OTTO -------------\n");
  27.     }else if(num == 9){
  28.       printf("--------------- TABELLINA DEL NOVE -------------\n");
  29.     }else if (num == 10) {
  30.       printf("--------------- TABELLINA DEL DIECI -------------\n");
  31.     }
  32.     for(fatt=0;fatt<=10;fatt++){
  33.       tab[num][fatt] = num*fatt;
  34.       printf("%d\n", tab[num][fatt]);
  35.     }
  36.   }
  37.   return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement