Wednesday, 27 January 2016

Print Table of any Number in C++

Print Table of any Number in C++

Hello friends, Hitesh is here; Today i will give you idea to Print Table of any Number in C++. In general table of any number is the multiplication of given number form 1 to 10. So you can first enter any number and multiply that number one by one from 1 to 10.

Print Table of any Number in C++

Table Program Code

#include<conio.h>
#include<iostream.h>
void main()
{
int table=0,i,n;
cout<<"Enter any number to generate table:";
cin>>n;
i=1;
while(i<=10)
{
table=n*i;i++;
cout<<"endl"<<table;
}
getch();
}

Output:

Enter any number to generate table:
6
12
18
24
30
36
42
48
54
60

No comments:

Post a Comment