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

If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

0 Answers  


What is lambda expression c++?

0 Answers  


How java is different from c and c++?

0 Answers  


Is std :: string immutable?

0 Answers  


What is a storage class used in c++?

0 Answers  






When should you use multiple inheritance?

2 Answers  


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

0 Answers  


What is function overriding?

1 Answers  


What is a c++ object?

0 Answers  


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

0 Answers  


How to access a variable of the structure?

0 Answers  


What is the full form of ios?

0 Answers  


Categories