 Here's the flowchart for a program that asks the user for a year and tells them whether it's a leap year or not Here's the code. There's nothing wrong with it, except that when we test the program It only does one year at a time If we want to test another year We have to run the program again and again What we'd really like is to run the program once and have it ask us over and over again for years This is a perfect use for a while loop. Here's a revised flowchart We'll ask for a year and then test a condition as long as the condition is true We process the year Ask for the next year and loop back to see if we should continue or not The question now becomes what's a good condition to test? We need some value for the year that will tell the program. Okay, I'm finished This value is called a sentinel value. It's a special value that doesn't represent valid data But instead tells the while loop that it's time to stop In this case our sentinel value is zero. This is an ideal sentinel There's no year zero so we can use that as our special. Okay, we finished value That means we continue the loop as long as the year is not zero Let's update our code. First, we'll change the description of the program to add that we do this Until the user gives us zero for the year We'll change our prompt to reflect that Enter a year or Zero says quit After we get the year we'll add our while with the condition year not equal to zero and an opening brace The test for leap year becomes the body of our loop We indent it and put a closing brace to close our while loop After we process one year, we have to add code to ask for the next year We'll print our prompt Enter another year or zero to quit And we'll get the user's next input Let's compile that and let's run it this time When I enter a year it asks me for another one and Another one and another one until I'm ready to stop I enter zero and the program ends and That's how you can use a loop to repeatedly ask for input