Advertisement
mominulkarim77

Leap Year- Not Leap Year by Saiful Saif Bhai

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