C Program to find that entered year is leap year or not

#include
void main()
{
 int a;
 printf("enter year\n");
 scanf("%d",&a);
 (a%100==0)?(a%400==0)?printf("Leap year\n"):printf("Notleap year\n"):(a%4==0)?printf("Leap year\n"):printf("Not leap year\n");
}

Output:

C Program to find that entered year is leap year or not using conditional operator

C Program to find that entered year is leap year or not C Program to find that entered year is leap year or not Reviewed by Prashant Sengar on December 23, 2017 Rating: 5

No comments:

Powered by Blogger.