Sunday, April 13, 2014

Find the leap year in C programming


Find the leap year in C programming




#include<stdio.h>

int main()
{
    int year;
    printf("Enter the year: ");
    scanf("%d",&year);

    if(((year%4 == 0) && (year%100 != 0)) || (year%400 == 0))
         printf("This year is leap year\n",year);
    else
         printf("This year is not leap year\n",year);

    return 0;
}

No comments:

Post a Comment