Answer to Question #301796 in C++ for Izha

Question #301796



Code


4. Decimal x Decimal


by CodeChum Admin



Now that we're done with integers, we're moving on to decimals!







Instructions:



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.



*Test Case 1


1.53·2.25·1.23


Output



A line containing the result with two decimal places.



2.80



*Test Case 2



Input



1.9 2.5 3.75



Expected Output



1.27

1
Expert's answer
2022-02-23T12:18:24-0500
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
	double num1;
	double num2;
	double num3;
	cin>>num1>>num2>>num3;
	double product=num1*num2;
	double quotient=product/num3;
	cout<<fixed<<setprecision(2)<<quotient<<"\n\n";
	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog