Question #279907

Write a C++ program that asks the user to enter the number of miles driven and gallons used for each full tank. The program should calculate and display the miles per gallon obtained for each full tank.



Expert's answer

#include <bits/stdc++.h>

using namespace std;

int main()
{
        double gallons = 12 miles = 350;
        double MPG = miles/gallons;
        cout << gallons << '\n'<<  miles << '\n' << MPG;

        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!

LATEST TUTORIALS
APPROVED BY CLIENTS