Answer: Write a program that prompts the user to input a number and prints its mulitiplication table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <stdio.h> int main() { int i, number; printf("Enter a number :"); scanf("%d", &number); printf("Multiplication table of %d:\n\n", number); for (i = 1; i <= 10; i++) { printf("%d x %d = %d\n", number, i, number * i); } return 0; } |
Program Output
1 2 3 4 5 6 7 8 9 10 11 12 13 | Enter a 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 |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.