Write a C program to Check whether a given year is a leap year or not. Complete information is given to you in this article, so read this article till the end.
जाने इस पोस्ट में क्या क्या है
Write a C program to Check whether a given year is a leap year or not
Hello Friends in this article Complete information is given to you to check given year is a leap year or not. So Read this article till the end.
Here is Code to Check whether a given year is a leap year or not.
Code:
#include<stdio.h>
int main(void)
{
int year;
printf("Please enter the year: ");
scanf("%d",&year);
if ((year%400==0) && (year%100==0) || (year%4==0))
{
printf("This is a leap year");
}
else
{
printf("IS not a leap year");
}
}
Output:
Please enter the year: 2022
IS not a leap year