CJCoding With Joseph
15free / daySign inCreate account

Read an int called year from standard input. A year is a leap year when it is divisible by 4, except that years divisible by 100 are NOT leap years unless they are also divisible by 400. If year is a leap year, print <year> is a leap year; otherwise print <year> is not a leap year.

For the input 2020 the output is exactly what is shown in Expected Output.

Expected output

2020 is a leap year

= newline. The output ends with a newline, so print one after the last line.

Hints3 available
Topics
If Statements
Auto-input
2020\n
This input is automatically fed to your program's stdin
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.