Last active
March 4, 2019 02:43
-
-
Save a2gs/ff2aa79b46f0328f7d732d7f99088cb7 to your computer and use it in GitHub Desktop.
Leap year calculation
This file contains 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
/* | |
* 1 - is | |
* 0 - is not | |
*/ | |
int a2gs_AddSubDate_isLeapYear(int year) | |
{ | |
if(year % 4 == 0){ | |
if(year % 100 == 0){ | |
if(year % 400 == 0) | |
return(1); | |
return(0); | |
} | |
return(1); | |
} | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A better solution: