Say I have an infinite loop, and I want to start over or terminate depending on what user inputs.
while( 1 ) // start the inifite loop
{
printf( "Enter your number: " ); // prompt
scanf( "%d", &operand1 ); // store user entered number into operand1
if ( operand1 == -1 ) {
// terminates
} else if ( operand1 <= 0 ) {
// repeat from top
}
}
I know I can use break to terminate the loop or exit() to terminate the program, but I don't know how to start over the loop...and I don't wanna use goto.
Thanks in advance!