Leap year or not in C - 👑 सार्थक मुंड S3 🤴🏻

Leap year or not in C

Leap year or not in C

Write a program (WAP) in C to know a year is Leap year or not.

#include <stdio.h>
int main()
{
   int year;
   printf("Enter Year : ");
   scanf("%d",&year);

   if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0))
      printf("%d is a leap year", year);
   else
      printf("%d is not a leap year", year);

   return 0;
}

Try it Yourself ➠


Leap year or not in C
OutPut : 1
Leap year or not in C
OutPut : 2
Must Read :-
  1. Blogger Tutorial
  2. C Programs
  3. C++ Programs
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads