// 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 using namespace std; int main() { char response; // initialize for first condition // check through loop do { cout << "Hey you! You at the keyboard! You're a jerk!!!\n"; cout << "Have you had enough (y/n)? "; cin >> response; } while (response == 'n' || response == 'N'); // control condition cout << "Have a nice day.\n"; return 0; }