Infinite for loop with break
#include <stdio.h>
int main(void) {
char ch;
for( ; ; ) { /* infinite for loop */
printf("Load, Save, Edit, Quit?\n");
do {
printf ("Enter your selection: ");
ch = getchar();
} while(ch!='L' && ch!='S' && ch!='E' && ch!='Q');
if(ch == 'Q')
break;
}
return 0;
}
Related examples in the same category