// Demonstrating the use of a while loop with a // condition. // Sasha Vassar Week 2, Lecture 4 // Problem: I want to keep eating ice cream until I eat total scoops 20 #include int main(void){ int scoops; //1. Control variable - initialise int sum = 0; while (sum <= 20) { //2. Test printf("How many ice creams scoops did you eat just now: "); scanf("%d", &scoops); //3. Update of the control sum = sum + scoops; } printf("You've eaten too much ice cream, have a break!\n"); return 0; }