// 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 = 0; // loop control variable while (i < level) // control condition { cout << "i = " << i << '\n'; cout << "You are a good person!!!!\n"; i++; // increment the counter } cout << "Final value of i = " << i << '\n'; return 0; }