Develop a C program to check whether a given year is LEAP YEAR or NOT using Nested if statement

Code

#include <stdio.h>

int main()
{
int year;

printf("Enter a year: ");
scanf("%d",&year);
if(year%4 == 0)
{
if( year%100 == 0)
{
if ( year%400 == 0)
printf("%d is a leap year.\n", year);
else
printf("%d is not the leap year.\n", year);
}
else
printf("%d is a leap year.\n", year );
}
else
printf("%d is not the leap year.\n", year);
return 0;
}

Output



try with your birth year