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