C Program to print multiplication table of a number | Display the multiplication table of a number entered by user

C Program to Print Multiplication Table of a given Number

Technology Topper

In this example, you will learn to generate the multiplication table of a number entered by the user. In this program we will use for loop to generate multiplication table of number which is provided by user.

C program:
#include <stdio.h>
int main() {
    int ni;
    printf("Enter the number: ");
    scanf("%d", &n);
    for (i = 1i <= 10; ++i) {
        printf("%d x %d = %d \n"nin * 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


Run Code: If you want run this code copy this code, paste here and run.

No comments: