C Multiplication Table
What Is Multiplication?
Multiplication is simply, the product of any two numbers.
Example
3 * 8 = 24 i.e) 8 + 8 + 8 = 24
C Program - Any Multiplication Table
Let us write a C program which should get a integer number that represent a table.
c-multiplication-table.c
#include <stdio.h>
int main()
{
int a, i;
printf("Enter a number : ");
scanf("%d",&a);
for(i = 1;i &< 11;i++)
{
printf("\n%d * %d = %d ", i, a, i*a);
}
return 0;
}
Enter a number : 21 1 * 21 = 21 2 * 21 = 42 3 * 21 = 63 4 * 21 = 84 5 * 21 = 105 6 * 21 = 126 7 * 21 = 147 8 * 21 = 168 9 * 21 = 189 10 * 21 = 210
Note:
Above program is quite simple, First get the integer input from the user and then print the multiples of user enter number from 1 to 10.
Did You Know?
You will be more good in logical thinking when you can simply answer any multiplication result instantly than your neighbour.

0 Comments