Skip to content

Instantly share code, notes, and snippets.

@lnds
Created March 11, 2012 16:26
Show Gist options
  • Select an option

  • Save lnds/2017018 to your computer and use it in GitHub Desktop.

Select an option

Save lnds/2017018 to your computer and use it in GitHub Desktop.
Determinación si un año es bisiesto
// 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