C++ Program to print table of any number


In this program, You will learn how to print table of any number in C++.


14 Table is :14 28 42 56 70 84 98 112 126 140


Example: How to print table of any number in C++

Run it Now
#include<iostream>
using namespace std;

int main() {

    int n, i, r;
    cout << "Enter any Number :";
    cin>>n;

    cout << "\nTable of " << n << endl;

    for (i = 1; i <= 10; i++) {
        r = n * i;
        cout << r << endl;
    }

    return 0;
}

Output:

Enter any Number :14
Table of 14
14
28
42
56
70
84
98
112
126
140