powered by
This function determines whether a given year is a leap year
leap_year(x)
boolean variable (TRUE or FALSE)
integer value, representing year number
Eike Luedeling, but based on pseudocode from Wikipedia
Takes a year number as input, and returns TRUE if this is a leap year, and FALSE if not
https://en.wikipedia.org/wiki/Leap_year
leap_year(2015) leap_year(2016)
Run the code above in your browser using DataLab