Question: Write a C + + program to compute miles per gallon given miles driven and gallons of gas used. It is taken from the Programming
Write a C program to computemiles per gallongivenmiles drivenandgallons of gas used.It is taken from the Programming Challenges section in your text: P # The problem specification is as follows:
Miles per Gallon
A car holds gallons of gasoline and can travel miles before refueling. Write a program that calculates the number of miles per gallon the car gets. Display the result on the screen.
Hint: Use the following formula to calculate miles per gallon MPG:
MPG Miles DrivenGallons of Gas Used
This is designed to help you learn how to write a simple C program and use a C expression to apply a formula to obtain the answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
