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 is an inclusion guard?

1 Answers  


Difference between Operator overloading and Functional overloading?

10 Answers   HP,


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

1 Answers   TCS,


What is a driver program?

1 Answers  


What is the main purpose of c++?

1 Answers  


What is virtual base class?

1 Answers  


How the keyword struct is different from the keyword class in c++?

1 Answers  


What is cloning?

1 Answers  


Can a Structure contain a Pointer to itself?

1 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

1 Answers  


What new()is different from malloc()?

1 Answers  


Can there be at least some solution to determine the number of arguments passed to a variable argument list function?

1 Answers  


Categories