In this we are going to see how to check whether the Year is a leap year or not  in C Programming.
#include <stdio.h>
void main()
{
int year;
printf("Enter year: ");
scanf("%d", &year);
if (year % 400 == 0)
{
printf("The year is leap year");
}
else if (year % 100 == 0)
{
printf("The year is not leap year");
}
else if (year % 4 == 0)
{
printf("The year is leap year");
}
else
{
printf("The year is not leap year");
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP