Q:

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

belongs to collection: C++ Basic Solved Programs

0

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.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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 .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Basic Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C++ Program to Reverse a Number using while loop... >>
<< C++ Program to find Factorial of a Number using Re...