Break a infinite loop
#include <stdlib.h> #include <stdio.h> int main(void) { for(;;) if(getchar()=='A') abort(); return 0; }
1. | indefinite loop and break | ||
2. | Use break to terminate a for loop | ||
3. | Use break in for loop to exit | ||
4. | Nested for loop and break |