aboutsummaryrefslogtreecommitdiff
path: root/simple-C-programs/MultiplicationTable.c
blob: 2135d3198419de60d7068e02933906612c811443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>

int main() { 

  printf("Multiplication table to 10x10\n");

  int multi_table[10][10];

  for(int i = 0;i < 10;i++) {
    for(int j = 0;j < 10;j++) {
      multi_table[i][j] = (j + 1) * (i + 1);
    }
  }

  for(int i = 1; i <= 10;i++) {
    for(int j = 1; j <= 10;j++) {
      printf("%d ", multi_table[i - 1][j - 1]);
      if ((j % 10) == 0) {
        printf("\n");
      }
    }
  }

  printf("\n");
  return 0;
  }