In this easy coded program, you will learn how to print table till 'n'.
You will have to take input of the number which will tell the compiler up to where it has to print the table(s).
---------------------------------------------------------------------------
Output
Hope you found this 'C Program to Print Table till 'n'' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
---------------------------------------------------------------------------
Program to Print Table till 'n'
/*Table till n*/
|
|
#include<stdio.h>
|
|
void main()
|
{
|
int
num, i, j, a;
|
j=1;
|
|
printf("Enter Number: ");
|
scanf("%d", &num);
|
|
while(j<=num)
|
{
|
for(i=1; i<=10; i++)
|
{
|
a = j * i;
|
printf("\n%d X %d = %d", j, i, a);
|
}
|
printf("\n");
|
j++;
|
}
|
}
|
Output
Enter Number: 3
1 X 1 = 1
1 X 2 = 2
1 X 3 = 3
1 X 4 = 4
1 X 5 = 5
1 X 6 = 6
1 X 7 = 7
1 X 8 = 8
1 X 9 = 9
1 X 10 = 10
2 X 1 = 2
2 X 2 = 4
2 X 3 = 6
2 X 4 = 8
2 X 5 = 10
2 X 6 = 12
2 X 7 = 14
2 X 8 = 16
2 X 9 = 18
2 X 10 = 20
3 X 1 = 3
3 X 2 = 6
3 X 3 = 9
3 X 4 = 12
3 X 5 = 15
3 X 6 = 18
3 X 7 = 21
3 X 8 = 24
3 X 9 = 27
3 X 10 = 30
---------------------------------------------------------------------------Hope you found this 'C Program to Print Table till 'n'' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
Comments
Post a Comment
Please do not comment any spam links in the comment box.