programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Check the Leap Year

Details
Written by: RajaSekhar
Category: C Programs
  • basic c programs
  • leap year program in c
#include<stdio.h>
void 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);
}

OUTPUT:

EX 1:

Enter Year : 2000
2000 is a Leap Year

EX 2:

Enter Year : 2004
2004 is a Leap Year

 

WHAT IS A LEAP YEAR ?

 A year is called leap year if it is divisible by 400 (OR) If that year is not divisible by 400 as well as 100 but it is divisible by 4 then that year is also a leap year.

 

Previous article: C Program for Sum of Digits of a Number Prev Next article: C Program to Find Given Number is Perfect or Not Next
  • C Program to Implement Structure with Pointers
  • FCFS CPU Scheduling Algorithm Simulation Using C
  • C Program to find Area of a Circle
  • Compute Factorial of Large Numbers using C
  • C program for Fibonacci Series using do-while Loop
  • C Program to Solve Tower of Hanoi Problem Using Recursive and Non-Recursive
  • Fizz Buzz Implementation in C
  • C Program to Find Number of Characters and Words in a String
  • C Program for Sum of Digits of a Number
  • C Program to Check Whether a Number is PALINDROME or Not
  • C Program to Reverse Elements in Array
  • C Program for Fibonacci Series using While Loop
  • C Program to Calculate Sum of Marks to Demonstrate Structures
  • C Program to ADD two MATRICES
  • Bit Stuffing Program in C
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top