Use the sentinel loop structure. Prompt the user and read the answer before the loop. While the answer isn't "no", put all of the code about entering the year and determining if it a leap year or not. Then at the bottom of the loop, prompt the user asking if the user wants to enter another year and read the answer.