C Program to Generate Multiplication Table of a Given Number

In this example, we take one user input from user and generate multiplication table.

C Program to Generate Multiplication Table

	
#include<stdio.h>
int main( )
{
    int n, i;
    printf("Enter the number :: ");
    scanf("%d",&n);
    printf("Multiplication Table of : %d\n",n);

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

Output :

	
Enter the number :: 12
Multiplication Table of : 12
12 * 1 = 12
12 * 2 = 24
12 * 3 = 36
12 * 4 = 48
12 * 5 = 60
12 * 6 = 72
12 * 7 = 84
12 * 8 = 96
12 * 9 = 108
12 * 10 = 120
	

Share your thoughts

Ask anything about this examples