hi i have been asked to input 2 integers, a drivers MILES and LITRES of fuel they have used.. i am then meant to printf the miles per litre for that specific entry AND a running total of the combined MPL's added so far...
Code:
#include <stdio.h>
int main( )
{
int miles;
int litres;
int tanks;
int mpl;
int totalmpl;
int counter;
while ( miles > 0, counter++ ) {
printf("please enter the amount of miles you have driven, alternatavely, press 0 to finish the script.\n");
scanf("%d", &miles);
printf("please enter the amount of litres you used\n");
scanf("%d", &litres);
mpl=miles/litres;
printf("the number of miles per litre you have gained is:%d\n", mpl);
while (counter > 1)
{
totalmpl=mpl+mpl;
printf("the total running miles per litre is:%d\n", totalmpl);
}
}
return 0;
}
this outputs nothing, if anyone can help i would be delighted. THANKS