-
-
Save CraigRodrigues/461e188fbd8a931e70f23baa27ad25b2 to your computer and use it in GitHub Desktop.
CS50x Coding Contest 2016 - One Day More
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
#include <stdio.h> | |
#include <math.h> | |
#include "cs50.h" | |
int main(void) | |
{ | |
int year = GetInt(); | |
if (year > 9999 || year < 0) | |
return 0; | |
if (year % 4 == 0) | |
{ | |
if (year % 100 == 0 && year % 400 != 0) | |
{ | |
printf("Not Leap Year"); | |
return 1; | |
} | |
printf("Leap Year"); | |
return 1; | |
} | |
else | |
printf("Not Leap Year"); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment