Answer to Question #267332 in C++ for CjA

Question #267332

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.


1
Expert's answer
2021-11-17T17:38:25-0500
#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main()
{
    float a,b,c;
    cout << "Input a decimal number: ";
    cin >> a;
    cout << "Input a decimal number: ";
    cin >> b;
    cout << "Input a decimal number: ";
    cin >> c;

    float d = a * b;

    float e = d / c;
    cout << fixed << setprecision(2) << e << endl;
    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
APPROVED BY CLIENTS