#include <stdio.h>
int main(void)
{
float total_way = 0, total_petrol = 0, petrol, way;
while (1) {
printf("Enter the gallons used (-1 to end): ");
scanf("%f", &petrol);
if (petrol == -1) {
printf("The overall average miles/gallon was %f\n", total_petrol == 0 ? 0 : total_way / total_petrol);
break;
}
printf("Enter the miles driven: ");
scanf("%f", &way);
printf("The miles/gallon for this tank was: %f\n", petrol == 0 ? 0 : way / petrol);
total_way += way;
total_petrol += petrol;
}
return 0;
}
#include <stdio.h>
int main() {
printf("int: %zu", sizeof(int));
printf("short: %zu", sizeof(short));
return 0;
}