โ 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: 2020 is a leap year
Expected Output:
2020 is a leap year
Topics:
If Statements
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.