Write a C++ Program to Multiply two Numbers



Write a C++ Program to Multiply two Numbers..

Answer / 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

More C++ General Interview Questions

What are function prototypes?

0 Answers  


How would you use the functions randomize() and random()?

0 Answers  


Does c++ have foreach?

0 Answers  


How can you create a virtual copy constructor?

0 Answers  


What is ios :: in in c++?

0 Answers  


Comment on assignment operator in c++.

0 Answers  


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

0 Answers  


What are templates? where we should use it?

2 Answers   Alcatel,


What are Virtual Functions? How to implement virtual functions in "C" ?

3 Answers  


Can we define a constructor as virtual in c++?

0 Answers  


What is the use of endl in c++ give an example?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  


Categories