C Program to Print Multiplication Table of any Number using For loop
ADVERTISEMENTS
C program to print multiplication table of any number using for loop. In this article, you will learn how to make a c program to print multiplication table of any number using for loop.
Source Code
// C Program to Print Multiplication Table of any Number using For loop
#include <stdio.h>
int main() {
int x, r, i;
// x - To store the input number
// r - To store the multiplication range
printf("Enter the input number is::\n");
scanf("%d", &x);
printf("\nEnter the range number is::\n");
scanf("%d", &r);
printf ("\n\n------The above multiplication table--------\n\n");
for (i = 1; i <= r; i++) {
printf("%d * %d = %d\n", x, i, x * i);
}
return 0;
}
Output
Enter the input number is::
10
Enter the range number is::
14
------The above multiplication table--------
10 * 1 = 10
10 * 2 = 20
10 * 3 = 30
10 * 4 = 40
10 * 5 = 50
10 * 6 = 60
10 * 7 = 70
10 * 8 = 80
10 * 9 = 90
10 * 10 = 100
10 * 11 = 110
10 * 12 = 120
10 * 13 = 130
10 * 14 = 140