Write a C++ Program to Multiply two Numbers

Answer Posted / hr

Solution:
/* 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 << "
Enter 2nd number :: ";
cin >> second;
product = first * second;
cout << "
Product of Two Numbers [ "<<first<<" * "<<second<<" ] = " << product<<"
";
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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an operator in c++?

611


What is static in c++?

591


What is a Default constructor?

913


What is the use of structure in c++?

550


Define Virtual function in C++.

619






What is array give example?

588


How many ways can a variable be initialized into in C++?

594


What is an undefined behavior and sequence points

563


How will you call C functions from C ++ and vice-versa?

655


Which operator cannot overload?

539


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

586


Tell me can a pure virtual function have an implementation?

553


What is unary operator? List out the different operators involved in the unary operator.

582


What is const in c++?

592


What are the basic data types used in c++?

551