C++ program to Print Multiplication Table of a given number

By | December 25, 2016

Print Multiplication Table of a given number


Write a C++ program to Print Multiplication Table of a given number. Here’s simple program to Print Multiplication Table of a given number in C++ Programming Language.


Here is source code of the C++ program to Print Multiplication Table of a given number. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


SOURCE CODE : :


/*  C++ program to Print Multiplication Table of a given number  */

#include<iostream>
using namespace std;

int main()
{
    int i,n,table=1;

    cout<<"Enter any positive number :: ";
    cin>>n;

    cout<<"\nMultiplication Table of a given number [ "<<n<<" ] :: \n\n";
    for(i=1;i<=10;i++)
    {
        table=n*i;
        cout<<"\t"<<n<<" * "<<i<<" = "<<table<<"\n\n";
    }

    return 0;
}

Output : :


/*  C++ program to Print Multiplication Tables of a given number  */

Enter any positive number :: 5

Multiplication Table of a given 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


Process returned 0

Above is the source code for C++ program to Print Tables of a given number which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

Leave a Reply