Dear all,
I am a seasonal programmer, and just got back to learn how to program in C again. I need a hand for showing my mistake, any help will be much appreciated.
thnks
Nico
I have to work around on the problem, but I got this warning after compiling this program:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
exercise.c:
Error E2379 exercise.c 14: Statement missing ; in function main
*** 1 errors in Compile ***
-----------------------------------------------------------------------------------
/* Calculate and display the average used of gasoline */
#include <stdio.h>
int main()
{
/* data type */
float average, gallons, totave;
int counter, miles;
/* initializing phase */
counter = 0
/* processing phase */
printf( "Enter the gallons used (-1 to end): " );
scanf( "%d", &gallons );
if ( gallons != -1 ) {
printf( "Enter the miles driven: " );
scanf( "%d", &miles );
average = gallons / miles;
counter = counter + 1;
printf( "The miles/gallon for this tank was %f", average );
totave = average / counter;
}
else
printf( "The overall miles/gallons was %f", totave );
return 0;
}