// 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 int main() { int level; // insecurity level int i = 0; // loop counter printf("How insecure are you, on a scale of 1-10? \n"); printf(" (where 1 is least insecure, 10 is most)\n> "); scanf("%d", &level); while (i < level) // control condition { printf("i = %d: ", i); printf("You are a good person!!!!\n"); i++; // increment the counter } printf("Final value of i = %d\n", i); return 0; }