Write a C program to input a number from user and print multiplication table of the given number using for loop.
#include<stdio.h>
int main()
{
int n;
printf("Please, enter a number to create mutltiplication table: ");
//Take input from user
scanf("%d",&n);
//Make loop from 1 to 10
printf("This is mutltiplication table from 1 to 10:\n");
for(int i=1;i<=10;i++)
{
printf("%d x %d = %d\n",n,i,i*n);
}
}
Comments
Leave a comment