lucproblem002.c (621B)
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 /* A year is entered through the keyboard, write a program to 8 determine whether the year is leap or not. Use the logical operators 9 && and || . */ 10 /* Let Us C, Chap - 4, Page - 64, Problem 4.1 */ 11 12 #include <stdio.h> 13 int main() 14 { 15 int year; 16 printf("Enter year : "); 17 scanf("%d", &year); 18 if (year % 4 == 0 && year & 100 != 0 || year % 400 == 0) 19 printf("\nYear %d is a leapyear.", year); 20 else 21 printf("\nYear %d is not a leapyear.", year); 22 return 0; 23 }