/* File: nobreak1.c Using a flag instead of break statement to control a while loop. */ #include int main() { int n, found ; found = 0 ; // 0 is false while (!found) { printf ("Enter: ") ; scanf("%d", &n) ; if (n == 7) { printf("7 is the lucky number\n") ; found = 1 ; } else { printf("Sorry, Try again\n") ; } } return 0 ; }