// a simple do-while-loop example. // keeps insulting the user until the user indicates he/she has had enough // Specifically, this loop continues as long as the user types 'n' or 'N' // to indicate "No". Anything else causes the loop to quit. #include int main() { char response; // initialize for first condition // check through loop do { printf("Hey you! You at the keyboard! You're a jerk!!!\n"); printf("Have you had enough (y/n)? "); scanf(" %c", &response); } while (response == 'n' || response == 'N'); // control condition printf("Have a lovely day.\n"); return 0; }