How would I use a while loop to keep requesting user input
Use a while loop above input line as: And, use if condition to break. Also, condition for leap year is wrong in your code. It should be: if((year % 100 == 0 && year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) //its a leap year else … Read more