How to find a product of three numbers in algorithm
Answers
How do you find the product of three numbers?
product = number1 * number2 * number3. print *, "The sum of the three numbers is ", total. print *, "The product of the three numbers is ", product. end program SumAndProduct.
Answer:
The answer to the given question is explained in the explanation.
Explanation:
In the c++ program,
first, declare three integer variables.
seconds, get user input for all three.
and then sum and product as we do in normal math.
Finally, print the values.
#include
using std::cout;
using std::cin;
using std::endl;
int main()
{
int x;
int y;
int z; Results
integers;
cout << "Enter three integers whose product is to be calculated:";
cin >> x >> y >> z; // read three integers from user whose product to be calculated
result = x * y * z;
cout << "Picture" << result << endl;
returns 0;
}
Enter three integers: 1 2 3
Product is 6
#SPJ3