Leap year: Difference between revisions
Content deleted Content added
Not a robot (talk | contribs) Add BCPL |
|||
Line 1,554:
=={{header|FutureBasic}}==
<lang futurebasic>window 1
// In-line C function to generate random number in range
Line 1,564 ⟶ 1,563:
}
EndC
toolbox fn randomInRange( long min, long max ) = long
// Leap year test function
local fn LeapYear( year as long ) as
if year mod 400 == 0 then result = _true : exit fn
Line 1,576 ⟶ 1,575:
end fn = result
// Array of known leap years from 1980 through 2020 for control
Line 1,586 ⟶ 1,585:
print "Known leap years:"
for i = 0 to 9
else
next
Line 1,598 ⟶ 1,597:
print "Check random years:"
for i = 0 to 20
next
HandleEvents</lang>
Output (results will vary for random years):
|