hello, friends today in this Multiplication Program In C we will see how we can generate the table of the given number by the user.
Multiplication Program In C
tablegeneration.c
#include<stdio.h>
int main()
{
int num;//ye wo number hoga jiska table user ko genarte karna hai
int i; //ye 1 se lekar 10 tak ke number ke liye hai
//sabse pahle user se input lenge
printf("enter the number whose table you want to generate\n");
scanf("%d",&num);
//uske badd for loop chalenge taki hum 10 tak ke ans ko print kar ske
printf("the table of %d is\n",num);
for(i=1;i<=10;i++)
{
printf("%d*%d = %d\n",num,i,num*i);
}
return 0;
}
- In the above C program first of all we included the header file.
- After that, I declared two variables that are num, i.
- num is for taking the input from the user and i is for running the loop.
- After that,
- we will run the loop and multiply the value of I by the number whose tables we want to generate.

Output Of The Program
D:\C-Program>gcc tablgeneration.c
D:\C-Program>.\a.exe
enter the number whose table you want to generate
3
the table of 3 is
3*1 = 3
3*2 = 6
3*3 = 9
3*4 = 12
3*5 = 15
3*6 = 18
3*7 = 21
3*8 = 24
3*9 = 27
3*10 = 30
I hope you will understand how we can do this program in C. Thank you keep visiting rkrknowledge.com.