In this easy coded program, you will learn how to print table of 2. You will not have to take any input from the user for this program.
Similarly, you can print table of any number by minor modifications in this program. Try doing them for self practice.
---------------------------------------------------------------------------
Output
Hope you found this 'C Program to Print Table of 2' 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.
Similarly, you can print table of any number by minor modifications in this program. Try doing them for self practice.
---------------------------------------------------------------------------
Program to Print Table of 2
/*Table of 2*/
|
#include<stdio.h>
|
void main()
|
{
|
int
i, a;
|
for(i=1;
i<=10;
i++)
|
{
|
a=2*i;
|
printf("\n2 X %d = %d", i, a);
|
}
|
}
|
Output
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
---------------------------------------------------------------------------Hope you found this 'C Program to Print Table of 2' 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.