Skip to content

Instantly share code, notes, and snippets.

@CraigRodrigues CraigRodrigues/leapyear.c Secret
Created Jul 30, 2016

Embed
What would you like to do?
CS50x Coding Contest 2016 - One Day More
#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
You can’t perform that action at this time.