Task

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



See also

 Leap year (wiki)


dcl mod  builtin;
dcl year fixed bin (31);
 
do year = 1900, 1996 to 2001;
  if mod(year, 4)    = 0 &
    (mod(year, 100) ^= 0 |
     mod(year, 400)  = 0) then
    put skip edit(year, 'is a leap year') (p'9999b', a);
  else
    put skip edit(year, 'is not a leap year') (p'9999b', a);
end;