Write a C++ Program to Calculate Multiplication of two Numbers

By | 23.12.2016

Multiplication of two Numbers


Write a C++ Program to Multiply two Numbers. Here’s simple C++ Program to Calculate Multiplication of two Numbers in C++ Programming Language.


In this program, user is asked to enter two numbers (floating point numbers). Then, the product of those two numbers is stored in a variable and displayed on the screen.

Here is source code of the C++ Program to Calculate Multiplication of two Numbers. 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 Calculate Multiplication of two Numbers  */

#include <iostream>
using namespace std;

int main()
{
    double first, second, product;

    cout << "Enter 1st number :: ";
    cin >> first;
    cout << "\nEnter 2nd number :: ";
    cin >> second;

    product = first * second;

    cout << "\nProduct of Two  Numbers [ "<<first<<" * "<<second<<" ] = " << product<<"\n";

    return 0;
}

Output : :


/*  C++ Program to Calculate Multiplication of two Numbers  */

Enter 1st number :: 5

Enter 2nd number :: 8

Product of Two  Numbers [ 5 * 8 ] = 40

Process returned 0

  • In this program, user is asked to enter two numbers. These two numbers entered by the user is stored in variable first and second respectively.
  • Then, the product of first and second is evaluated and the result is stored in variable product.
  • Finally, the product is displayed on the screen.

Above is the source code for C++ Program to Calculate Multiplication of two Numbers 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….

 

3.8 8 votes
Article Rating
Category: Basic Programs C++ Programming Tags:

About Tunde A

My name is Tunde Ajetomobi, a Tech Enthusiast and Growth Hacker. I enjoy creating helpful content that solves problem across different topics. Codezclub is my way of helping young aspiring programmers and students to hone their skills and find solutions on fundamental programming languages.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments