The fault was in this line:
printf("Miles per gallon: %d, &milespergallon");
Also your quit logic was a little off.
This should do the job.
Code:
#include <stdio.h>
int main()
{
int input_value, final, gallons, milespergallon;
printf("What is your initial odometer reading:\n");
scanf("%d", &input_value);
while ( input_value > 0 )
{
printf("What is your final odometer reading:\n");
scanf("%d", &final);
printf("What is the number of gallons of gas:\n");
scanf("%d", &gallons);
milespergallon = ( final - input_value ) / gallons;
printf("Miles per gallon: %d", milespergallon);
printf("\n\nWhat is your initial odometer reading:\n");
scanf("%d", &input_value);
}
return 0;
}
EDIT -
[edit]Beat by Lightening boy
That's cuz you're too busy editting code tags. You and your superpowers