The purpose of this lab is to write a program to calculate a car's fuel economy based on the number of miles driven and the number of gallons of fuel used.
If you have a solution open in Visual Studio, close it (File->Close Solution).
Download lab6.zip. Import it into Visual Studio (File->Import...).
Add your code to the source file called MilesPerGallon.c.
Your task is to write a program that will prompt the user for
quantities. First, the number of miles driven.
number of gallons of fuel used.
After reading these two quantities into variables, you should
compute the fuel economy in miles per gallon. Your program should display one digit to the right of the decimal point.
Here is an example run of the program. User input is
shown in bold
Miles driven: 400
Gallons of fuel used: 14.7
Fuel economy was 27.2 miles per gallon
The number of miles driven an number of gallons of fuel used
necessarily whole numbers. Your program should handle
The fuel economy will not necessarily be a whole number.
In Visual Studio, press "Control-F5" to compile and run your program.