Problem

Write a program that accepts a year and determines whether or not the year is a leap year....

Write a program that accepts a year and determines whether or not the year is a leap year. Use the mod function. The output should be the variable extra_day, which should be 1 if the year is a leap year and 0 otherwise. The rules for determining leap years in the Gregorian calendar are:

1. All years evenly divisible by 400 are leap years.


2. Years evenly divisible by 100 but not by 400 are not leap years.


3. Years divisible by 4 but not by 100 are leap years.


4. All other years are not leap years.

For example, the years 1800, 1900, 2100, 2300, and 2500 are not leap years, but 2400 is a leap year.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4