Task

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



See also

 Leap year (wiki)


get "libhdr"
 
let leap(year) = year rem 400 = 0 | (year rem 4 = 0 & year rem 100 ~= 0)
 
let start() be 
$(  let years = table 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1999,
                      2000, 2001, 2002, 2003, 2004, 2021, 2022
    for i = 0 to 14 do
        writef("%N %S a leap year.*N", 
               years!i, leap(years!i) -> "is", "is not")
$)