You will get the C++ program to print the table on any number. The user will enter a number and its table will be printed.
The concept of generating a table of any number is multiplied a particular number from 1 to 10.
num * 1
num * 2
num * 3
num * 4
num * 5
num * 6
num * 7
num * 8
num * 9
num * 10
C++ Program to Print Table of Any Number –Loops
#include<iostream>
using namespace std;
int main()
{
int i,n;
cout<<"Enter any Number:";
cin>>n;
for(i=1;i<=10;++i)
cout<<"\n"<<n<<" * "<<i<<" = "<<n*i;
return 0;
}
Output of Program
Enter any Number:5
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50