check leap year

#include<stdio.h>
int main() {
    int year;
    scanf("%d",&year);
     (year%4==0 && year%100!=0) ? printf("LEAP YEAR") :
        (year%400 ==0 ) ? printf("LEAP YEAR") : printf("NON LEAP YEAR");
   return 0; 
}

No comments:

Post a Comment