Write a C program to Check whether a given year is a leap year or not. – Very Useful

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.

WhatsApp Group (Join Now) Join Now
Telegram Group (Join Now) Join Now
Write a C program to Check whether a given year is a leap year or not
Write a C program to Check whether a given year is a leap year or not

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

Shubham Kumar
Shubham Kumar
Shubham Kumar is a passionate blogger with a deep interest in providing the latest information on jobs, education, scholarships, and government schemes. His mission is to empower his readers with the knowledge they need to achieve their goals and lead fulfilling lives.

Leave a Comment