← Back to If Statements
Question 339
Leap Year Check (Input)
Leap Year Check (Input)
Read anintcalledyearfrom standard input. A year is a leap year when it is divisible by4, except that years divisible by100are NOT leap years unless they are also divisible by400. Ifyearis a leap year, print<year> is a leap year; otherwise print<year> is not a leap year. For the input2020the output is exactly what is shown in Expected Output.
Expected Output:
2020 is a leap year= newline. The output ends with a newline — print one 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 (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.