bsc

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

root / semester_1 / letusc / lucproblem002.c

lucproblem002.c (485B)


      1 /* A year is entered through the keyboard, write a program to
      2 determine whether the year is leap or not. Use the logical operators
      3 && and || . */
      4 /* Let Us C, Chap - 4, Page - 64, Problem 4.1 */
      5 
      6 #include <stdio.h>
      7 int main()
      8 {
      9     int year;
     10     printf("Enter year : ");
     11     scanf("%d", &year);
     12     if (year % 4 == 0 && year & 100 != 0 || year % 400 == 0)
     13         printf("\nYear %d is a leapyear.", year);
     14     else
     15         printf("\nYear %d is not a leapyear.", year);
     16     return 0;
     17 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror