Answer to Question #46560 in C++ for Lei Reyes

Question #46560
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;
}

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
APPROVED BY CLIENTS