Question: Write a program that asks the user to enter a year and the program should then display whether the year entered is or is not

Write a program that asks the user to enter a year and the program should then display whether the year entered is or is not a leap year.
To determine a leap year:
- determine whether the year is divisible by 100(with no remainder)
- and then if it is, then it is a leap year if and only if it is divisible by 400(with no remainder).
For example, 2000 is a leap year but 2100 is not.
If the year is not divisible by 100, then it is a leap year if and only if it is divisible by 4(with no remainder).
For example, 2008 is a leap year but 2009 is not.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!