Task

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



See also

 Leap year (wiki)



10  ' Leap year
20  DEF FN ISLEAPYEAR(Y%) = ((Y% MOD 4 = 0) AND (Y% MOD 100 <> 0)) OR (Y% MOD 400 = 0)
95  ' *** Test ***
100 FOR I% = 1 TO 5
110  READ YEAR%
120  PRINT YEAR%; "is ";
130  IF FN ISLEAPYEAR(YEAR%) = 0 THEN PRINT "not "; ELSE PRINT "";
140  PRINT "a leap year."
150 NEXT I%
160 END
200 DATA 1900, 1994, 1996, 1997, 2000
 