Skip to main content

Problem Statement

Write a C program that takes a number as input and prints its multiplication table from 1 to 10.

Solution

#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= 10; i++) {
        printf("%d x %d = %d\n", n, i, n * i);
    }
    return 0;
}

Input

5

Output

5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
...
5 x 10 = 50