How to print the first N tables in c language using for loop
In this post, you will learn to create the multiplication table of a number entered by the user.
For better understand this example, you should have the knowledge of the following C programming topics:
- C Programming Operators
- C for Loop
Program to print the first N tables in c language using for loop
#include<stdio.h>
main()
{
int n,i,m,j;
printf("\n Enter the value of N :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n TABLE OF %d IS: ",i);
for(j=1;j<=10;j++)
{
m=i*j;
printf("\n %d %d %d",i,j,m);
}
getche();
}
getche();
}
Output:
Enter the value of N: 3TABLE OF 1 IS: 1*1=11*2=21*3=31*4=41*5=51*6=61*7=71*8=81*9=91*10=10TABLE OF 2 IS:2*1=22*2=42*3=62*4=82*5=102*6=122*7=142*8=162*9=182*10=20TABLE OF 3 IS:3*1=33*2=63*3=93*4=123*5=153*6=183*7=213*8=243*9=273*10=30 of the series.
Please do not entering spam link in the comment box ConversionConversion EmoticonEmoticon