Write a c program to print multiplication table of any number using for loop

Write a c program to print multiplication table of any number using for loop. This program will print the multiplication table in c language

#include<stdio.h>
int main()
{
int number, i, tab;
printf("Enter the number");
scanf("%d", &number);
printf("\nTable of %d is:\n", number);
for(i=1; i<=5; i++)
{
tab = number*i;
printf("%d * %2d = %2d\n", number, i, tab);
}
return 0;
}

 

Output:

Enter the number5     

Table of 5 is:                                 

5 *  1 = 5

5 *  2 = 10
5 *  3 = 15
5 *  4 = 20 
5 *  5 = 25