← Back to If Statements
Question 215
Leap Year Check
Leap Year Check
A year is a leap year if it is divisible by 4, except that years divisible by 100 are not leap years unless they are also divisible by 400. So 2024 and 2000 are leap years, but 1900 is not. Read one integer year and print Leap year or Not a leap year. This combines several conditions, so use the logical operators && (and) and || (or) inside one if statement.
Expected Output:
Leap year= newline. No newline after the last line.
Hints3 available
Sign in to use hintsTopics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.