0
CHALLENGE : LEAP YEAR
make a code in java to check weather given year is leap year or not. ( warning : without any if, else..if, nested if statement )
3 Respostas
+ 1
public boolean isLeapYear(int y){
return y>0 && y%4 && (!(y%100) || y%400);
}
- 1
heres mine in one line....
input the year
True=leapyear
False=not a leapyear
https://code.sololearn.com/c4ezxk022VXS/?ref=app