Question: Write a program in C++ language that determines if a given year is a leap year. Leap years are those years that are divisible by
Write a program in C++ language that determines if a given year is a leap year. Leap years are those years that are divisible by four, except that century years not divisible by 400 are not leap years. For example, 1960, 1996, and 2000 are leap years, while 1961, 1995, and 1900 are not.
Your program should ask the user to enter a year and then determine whether that year is a leap year. Repeat until the user enters 0 for the year. The following is an example program run (the users input is bold).
Enter a year (0 to stop): 1960
1960 is a leap year.
Enter a year (0 to stop): 1996
1996 is a leap year.
Enter a year (0 to stop): 2000
2000 is a leap year.
Enter a year (0 to stop): 1961
1961 is not a leap year.
Enter a year (0 to stop): 1995
1995 is not a leap year.
Enter a year (0 to stop): 1900
1900 is not a leap year.
Enter a year (0 to stop): 0
Bye.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
