Task

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



See also

 Leap year (wiki)


procedure main(arglist)
every y := !([2000,1900,2012]|||arglist) do
  write("The year ",y," is ", leapyear(y) | "not ","a leap year.")
end
 
procedure leapyear(year)		#: determine if year is leap
   if (numeric(year) % 4 = 0 & year % 100 ~= 0) | (numeric(year) % 400 = 0) then return
end