Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallons the automobile can be driven. The program outputs the number of miles the automobile can be driven without refuelling.
1
Expert's answer
2014-09-29T15:08:52-0400
#include <stdlib.h> #include <iostream> // for cout and cin #include <stdio.h> #include <cstdlib> // for system using namespace std; int main() { int fuelTank; int milesPerGallons; cout<<"Enter the capacity, in gallons, of an automobile fuel tank : "; cin>>fuelTank; cout<<"Enter the miles per gallons the automobile can be driven : "; cin>>milesPerGallons; cout<<"Automobile can be driven without refuelling "<<fuelTank * milesPerGallons<<" miles."<<endl; system("pause"); return 0; }
Comments
Leave a comment