i am having trouble ending these statements, when i enter -1 i want to return the message as stated but it end and return to the bash shell. What can i do? i tried adding return 0, break, etc.. it still wont work.Code:printf( "Enter the number of gallons used, (-1 to end): " ); scanf( "%f", &gallons ); if ( gallons == -1 ) printf( "No miles or gallons were entered\n" ); else if ( gallons != -1 ) printf( "Enter the number of miles driven: " ); scanf( "%f", &miles );
I have a 'while' statement later on but this condition stated here is only when the user inputs no data at the very beginning.
THANKS