Search This Blog

Translate

c program to find leap year using ternary operator

c program to find leap year using ternary operator

c program to find leap year Conditional Operators


   #include
   #include
   void main()
   {
    int y;
    printf("\n Enter the year:");
    scanf("%d",&y);
    if(y%4==0 && y%100 !=0 ||y%400==0)
     printf("\n Entered year is leap year!!!!!!!");
    else
       printf("\n Entered year is not leap year!!!!!!!");
    getch();
   }

C Program example List

Google+ Badge