C LAB‎ > ‎(Sem1) Introduction to C‎ > ‎

WAP to display the multiplication table of entered number.

posted Nov 18, 2010, 4:41 AM by Neil Mathew   [ updated Nov 18, 2010, 4:44 AM ]


SOURCE CODE:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
 
int main()
{
int i,n,a;
 
printf("\nEnter the number whose table is to be printed : ");
scanf("%d",&n);
for(i=1;i<11;i++)
{
a=n*i;
printf("%dx%i=%d \n",n,i,a);
}
return 0;
}
 

 

 

OUTPUT:

 

Enter the number whose table is to be printed : 5
5x1=5 
5x2=10 
5x3=15 
5x4=20 
5x5=25 
5x6=30 
5x7=35 
5x8=40 
5x9=45  
5x10=50  

 


Comments