ADS

C Programming Codes to check the current year is leap year or not | C Programming

C Programming Codes to check the current year is leap year or not | C Programming Language

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

OUTPUT

C program to check the current year is leap year or not


Post a Comment

0 Comments