• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
August 01, 2022 |2.4K Views
C Program to Check Leap Year
  Share  1 Like
Description
Discussion

In this video, we will see C Program to Check leap year

A year is said to be a leap year if the following conditions are satisfied: 
1) The year is multiple of 400. 
2) The year is a multiple of 4 and not a multiple of 100. 

Conditions for leap year: 
1. A year must be divisible by 400 then it is a leap year. 
2. If the year is divisible by 100 then it is not a leap year. 
3. Else if the year is divisible by 4 then is a leap year. 
4. If all conditions are false then enter year is not leap year. 

We will be using 2 approaches to do this program:
1. Using User defined function 
2. Using Conditional operators 

Example: 
Input year: 2024 
Output: Yes 

Input year:2022 
Output: No 

Apart from that, we will see the time and space complexity of both approaches. 

C Program to Check Leap Year:
https://www.geeksforgeeks.org/c-program-to-check-leap-year/