// Creat an array of size 3 X 10 containing multiple table of the
number 2, 7, and 9 respectively Using function.
#include<stdio.h>
int printTable(int *mulTable, int num, int n){
printf("The multip;ication table of %d is--->\n ", num);
printf("\n");
for(int i=0; i<n; i++){
mulTable[i] = num * (i + 1);
}
for(int i=0; i<n; i++){
printf("%d X %d = %d\n", num, i+1, mulTable[i]);
}
}
int main()
{
int mulTable[3][10];
printTable(mulTable[0], 2, 10);
printf("****************************************\n");
printTable(mulTable[1], 7, 10);
printf("****************************************\n");
printTable(mulTable[2], 9, 10);
return 0;
}
OUTPUT--->
The multip;ication table of 2 is--->
2 X 1 = 2
2 X 2 = 4
2 X 3 = 6
2 X 4 = 8
2 X 5 = 10
2 X 6 = 12
2 X 7 = 14
2 X 8 = 16
2 X 9 = 18
2 X 10 = 20
*************************************************************
The multip;ication table of 7 is--->
7 X 1 = 7
7 X 2 = 14
7 X 3 = 21
7 X 4 = 28
7 X 5 = 35
7 X 6 = 42
7 X 7 = 49
7 X 8 = 56
7 X 9 = 63
7 X 10 = 70
*************************************************************
The multip;ication table of 9 is--->
9 X 1 = 9
9 X 2 = 18
9 X 3 = 27
9 X 4 = 36
9 X 5 = 45
9 X 6 = 54
9 X 7 = 63
9 X 8 = 72
9 X 9 = 81
9 X 10 = 90
No comments:
Post a Comment