Answer to Question #279907 in C++ for Charls Pakingking

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.



1
Expert's answer
2021-12-15T11:38:15-0500
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog