Advertisement
Waliul

Leap Year

Jan 8th, 2020
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int year;
  6.     scanf("%d", &year);
  7.     if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
  8.     {
  9.         printf("%d is a leap year", year);
  10.     }
  11.     else
  12.     {
  13.         printf("%d is not a leap year", year);
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement