Created
March 11, 2012 16:26
-
-
Save lnds/2017018 to your computer and use it in GitHub Desktop.
Determinación si un año es bisiesto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // este es un ejemplo para www.programando.org | |
| /* return 1 si el año es bisiesto, 0 si no lo es. | |
| Esta función es muy simple y no considera hechos históricos asociados al calendario gregoriano.*/ | |
| int is_leap(int year) | |
| { | |
| return ((year % 4) == 0) && ( (year % 100) != 0 || (year % 400) == 0 ); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment