C Program to Print Multiplication Table of a given Number

#include <stdio.h>
int main() {
int n, i;
printf("Enter the number: ");
scanf("%d", &n);
for (i = 1; i <= 10; ++i) {
printf("%d x %d = %d \n", n, i, n * i);
}
return 0;
}
Output:
Enter the number: 9
Multiplication Table of 9
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: