bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

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 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror