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 / tuition-c / P024.c

P024.c (535B)


      1 /* WAP to check whether a year is leapyear or not. */
      2 // This code has not been compiled. 
      3 // If you find any issues, please create a new issue on GitHub regarding them.
      4 
      5 #include <stdio.h>
      6 int main()
      7 {
      8     int year;
      9     printf("Enter the year : ");
     10     scanf("%d", &year);
     11     if (year % 4 == 0 && year % 100 != 0)
     12         printf("\nYear %d is a leapyear.", year);
     13     else if (year % 400 == 0)
     14         printf("\nYear %d is a leapyear (Century).", year);
     15     else
     16         printf("\nYear %d is not a leapyear.", year);
     17     return 0;
     18 }