Question: 2. (50 pts) Write a C program q2.c that prompts the user for the number of miles traveled (as a float) and the number of

2. (50 pts) Write a C program q2.c that prompts the user for the number of miles traveled (as a float) and the number of gallons of gasoline consumed. - Compute and display the miles-per-gallon value, showing two places to the right of the decimal. - Given that one gallon is about 3.785 liters, and one mile is about 1.609 kilometers, convert the mile-per-gallon value to a liters-per-100- km value and display the result, showing one place to the right of the decimal. Use symbolic constants (using const or \#define) for the two conversion factors. Example of output: Fq2 Enter number of miles travelled: 300 Enter number of gallons of gas used: 10.2 Mile-per-gallon: 29.41 Liters-per-100-km: 8.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
