Page 1 of 1

I'm only interested in leap years. So if the inputted year is not a leap year, give me the next soonest leap year. IN JA

Posted: Mon May 09, 2022 6:22 am
by answerhappygod
I'm only interested in leap years. So if the inputted year is
not a leap year, give me the next soonest leap year.
IN JAVA CODE:
A year is considered a leap year when it is either:
(a) divisible by 4, but not 100 or
(b) divisible by both 4, 100, and 400 at the same time
Input
A single line containing a number that represents a year.
1702
Output
The next soonest leap year if the input is not a leap year.
Otherwise, output "Leap year".
The next leap year is 1704
Test Case 2:
Input
Output