Solution to Input three decimal numbers in one line separated by spaces, and make sure to store … - Sikademy
Author Image

Archangel Macsika

Input three decimal numbers in one line separated by spaces, and make sure to store them in different variables. Multiply the 1st and 2nd decimal numbers, and store the product into a variable. Then, divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out its quotient, with 2 decimal places. Input A line containing three decimal numbers with two decimal places separated by a space. 1.53·2.25·1.23 Output A line containing the result with two decimal places. 2.80

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> #include <iomanip> using namespace std; int main() { //Input three decimal numbers in one line separated by spaces, and make sure to store them in different variables. double number1; double number2; double number3; cin>>number1>>number2>>number3; //Multiply the 1st and 2nd decimal numbers, and store the product into a variable. double product=number1*number2; //Then, divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number,  //then print out its quotient, with 2 decimal places. double quotient=product/number3; cout<<fixed<<setprecision(2)<<quotient<<"\n\n"; system("pause"); return 0; }


Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1112-qpid-108