Arvinth is working as a lorry driver under a company, He has to calculate every
day's
a) Total miles driven per day.
b) Cost per gallon of gasoline.
c) Average miles per gallon.
d) Parking fees per day.
e) Tolls per day.
and submit to his company to get his allowances
Daily driving cost = (Total miles / Miles per gallon)* gasoline price + parking fees
+ Tolls.
Answers
Answered by
4
Answer:
#include<stdio.h>
int main()
{
float miles=0,cpg=0,avgmpg=0,rate=0;
int parking=0,toll=0;
scanf("%f%f%f%d%d",&miles,&cpg,&avgmpg,&parking,&toll);
rate=((miles/avgmpg)*cpg)+parking+toll;
printf("Cost: %.2f",rate);
}
Explanation:
Happy Coding
Similar questions