c-programs-basics
We are going to code multiplication table program in c, wherein we get a number from the user and print multiplication table of that number using for loop.

C Program To Display Multiplication Table

#include<stdio.h>
#include<conio.h>
void main()

{

int n,i,a=1;
clrscr();

 printf("\n Enter Any Number : ");
 scanf("%d",&n);

 if(n<=0)
 printf("\n Negative Number Or Zero Not Allowed ! ");

 else

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

 getch();
 }

Output : 

Output-Multiplication-Table-Of-Number-Using-For-Loop













In the above program, we multiply the number entered by the user with 1 to 10 with the help of a for loop and store the value in variable 'a' each time the loop is executed.

Check the programs we can do with the help of Loop In C.


Thus, we get multiplication table of the entered number and we print it using the printf statement in c.

Know, How to display something on the output screen in the first c program.