Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in liters/200km[for odd roll numberstudents]) as my roll no is odd. Program must be in C language not in c++ Must use user define function
in liters/200km[for odd roll numberstudents]) as my roll no is odd. Program must be in C language not in c++ Must use user define function where required. Hoping for a quick reply.
Because of the high price of petrol, you are concerned with the fuel consumption of your car. As a result, you have a record of the kilometers driven and liters used for each tank of petrol you purchase. Write a program that will display the kilometers driven, liters used, and consumption (in liters /100 km (for even roll number students]) (in liters /200 km [for odd roll number students]) for each tankful. After processing all the input information, the program should calculate the overall average consumption. Construct the User-defined function to calculate overall average consumption. Sample Output: Enter the liters used (-1 to end): 57.6 Enter the kilometers driven: 459 The liters/100km for this tank was 12.5 Enter the liters used (-1 to end): 45.3 Enter the kilometers driven: 320 The liters/100km for this tank was 14.2 Enter the liters used (-1 to end): -1 The overall average consumption was: 13.4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started