C++ Program to Print Table of a Given Number

In this program, the user is ask to enter the integer number, then the table of that number is the output will shown on console.



Source Code
#include <iostream>
using namespace std;

int main()
{
    int num, i=1;

    cout<<"Enter the number: ";
    cin>>num;

    cout<<"Table of " << num << endl;
    while(i <= 10)
    {
        cout<< num*i << endl;
        i++;
    }
    return 0;
}
Output
Enter the number: 5
Table of 5 is as
5
10
15
20
25
30
35
40
45
50