// a simple while-loop example. // this program will print out an encouraging message to a user, // a number of times that is based on how insecure he/she feels #include using namespace std; int main() { int level; cout << "How insecure are you, on a scale of 1-10? \n" << " (where 1 is least insecure, 10 is most)\n> "; cin >> level; int i = level; // loop control variable while (i > 0) // control condition { cout << "You are a good person!!!!\n"; cout << "i = " << i << '\n'; i--; // decrement the counter } cout << "Final value of i = " << i << '\n'; return 0; }