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 is c++ library?
Do you know the use of vtable?
What is a virtual destructor? Explain the use of it?
What are punctuators in c++?
write a program to add two numbers without using an arithmetic operator.
What is operator overloading in c++ example?
write a program to insert an element into an array
How do pointers work?
What are the advantages of C++ programming compared to C programming?
Write a c program for binary addition of two 8 bit numbers.
why is c++ called oops? Explain
Differentiate between the message and method in c++?