DEV Community

Cover image for Let's Start with "C"
Electronic Spencer
Electronic Spencer

Posted on

Let's Start with "C"

#include<stdio.h>
int main()
{
int year;
printf("Enter the year:- ");
scanf("%d",&year);
if(year%100 !=0)
{
if(year%4 ==0)
{
printf("This is a leap Year");
}
else
{
printf("This is not a leap Year");
}
}
else
{
if(year%400 == 0)
{
printf("This is a leap year");
}
else
{
printf("This is not a leap year");
}
}
return 0;
}

Top comments (1)

Collapse
 
specer profile image
Electronic Spencer

Unfortunately, we are not in the leap year. </>