Write a C++ Program to Multiply two Numbers
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 |
What are function prototypes?
How would you use the functions randomize() and random()?
Does c++ have foreach?
How can you create a virtual copy constructor?
What is ios :: in in c++?
Comment on assignment operator in c++.
write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;
What are templates? where we should use it?
What are Virtual Functions? How to implement virtual functions in "C" ?
Can we define a constructor as virtual in c++?
What is the use of endl in c++ give an example?
what are the iterator and generic algorithms.