Created
November 8, 2015 15:45
-
-
Save ilake/9c6653aef013a44c5d96 to your computer and use it in GitHub Desktop.
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
#include "stdio.h" | |
bool leap_year(int y) { | |
int is_leap; | |
is_leap = (y % 400 == 0) || | |
((y % 4 == 0) && !(y % 100 == 0)); | |
return is_leap; | |
} | |
int main(void) { | |
if (leap_year(2016)) { | |
printf("2016 is leap year"); | |
} | |
else { | |
printf("2016 is not leap year"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment