luc044.c (725B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Any year is entered through the keyboard. Write a function to 8 determine whether the year is aleap year or not. */ 9 /* Let Us C, Chap- 8, Page - 144, Qn No.: C(1) */ 10 11 #include <stdio.h> 12 13 int leapYear(int); 14 15 int leapYear(int year) 16 { 17 if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) 18 return 1; 19 else 20 return 0; 21 } 22 23 int main() 24 { 25 int year; 26 printf("Enter the year : "); 27 scanf("%d", &year); 28 if (leapYear(year)) 29 printf("\nYear %d is a Leap Year.", year); 30 else 31 printf("\nYear %d is not a Leap Year.", year); 32 return 0; 33 }