bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / letusc / luc024.c

luc024.c (416B)


      1 /* Write a program using conditional operators to determine whether
      2 a year entered through the keyboard is a leap year or not. */
      3 /* Let Us C, Chap- 4, Page - 72, Qn No.: E(b) */
      4 
      5 #include <stdio.h>
      6 int main()
      7 {
      8     int year;
      9     printf("Enter the year : ");
     10     scanf("%d", &year);
     11     printf("\nYear %d is %s a Leapyear.", year, (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) ? "" : "NOT");
     12     return 0;
     13 }