Any year is input through the keyboard. Write a program to determine whether the year is a leap year or not.


 /*Program to check the years is a leap year or not

  Author:Priyanshu, Date: November20,2020*/


#include<stdio.h>

#include<conio.h>


main()

  {

     int year;

     clrscr();

     printf("Enter the year:");

     scanf("%d",&year);

     if(year%4==0)

       {

if(year%100==0)

   {

     if(year%400==0)

       {

printf("leap year");

       }

     else

       {

printf("not leap year");

       }

   }

else

   {

     printf("Leap year");

   }

       }

     else

       {

printf("not leap year");

       }

     getch();

     return(0);

  }

Comments