Task

Determine whether a given year is a leap year in the Gregorian calendar.



See also

 Leap year (wiki)


func isLeap(y) {
    if y % 100 == 0 {
        y % 400 == 0
    } else {
        y % 4 == 0
    }
}
 
print(isLeap(1984))