write a C++ program to find two number and find its product
Answers
Answer:
#include <iostream>
using namespace std;
int main() {
float a, b, product;
cout << "Enter two Numbers\n";
cin >> a >> b;
product = a*b;
cout << "Product = " << product;
return 0;
}
Explanation:
Output
Enter two Numbers
2.5 3
Product = 7.5
c++ program fir finding product of two numbers:
#include <iostream>
using namespace std;
int main()
{
double firstNumber, secondNumber, productOfTwoNumbers;
cout << "Enter two numbers: ";
// Stores two floating point numbers in variable firstNumber and secondNumber respectively
cin >> firstNumber >> secondNumber;
// Performs multiplication and stores the result in variable productOfTwoNumbers
productOfTwoNumbers = firstNumber * secondNumber;
cout << "Product = " << productOfTwoNumbers;
return 0;
}