C++ program to print table of a given number














































C++ program to print table of a given number



Program Description

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>
using namespace std ; int main() { 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
3 * 1 = 3 3 * 2 = 6 3 * 3 = 9 3 * 4 = 12 3 * 5 = 15 3 * 6 = 18 3 * 7 = 21 3 * 8 = 24 3 * 9 = 27 3 * 10 = 30


Comments