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.
#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;
}
Comments
Leave a comment