How to check the year is leap year or not?

CODE




How to check the year is leap year or not?
int main()
{
    int y;
    printf("\n enter an year:");
    scanf("%i",&y);
    if((y%4==0&&y%100!=0)||(y%400==0))
        printf("\n the year is a leap year");
    else
        printf("\n the year is not a leap year");
}


Output:
enter an year:
2000

 the year is a leap year

How to check the year is leap year or not? How to check the year is leap year or not? Reviewed by Unknown on December 15, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.