In this article, we will see how to print a multiplication table of a given number. Here we will print the multiplication table up to 10.
C++ program to find multiplication table of a number
#include<bits/stdc++.h>usingnamespacestd ;
intmain(){
int n , i;
cout<<"Enter the number to print its multiplication table: \n";
cin>>n;
for(i=1 ; i <= 10 ; i++)
{
cout<< n <<" * "<< i << " = "<< n*i <<"\n";
}
}
Output :
Enter the number to print its multiplication table : 3
Comments