Guest User

Untitled

a guest
Oct 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include "stdio.h"
  2.  
  3. int isLeapYear(int year)
  4. {
  5. if (year%400==0)
  6. year=1;
  7. else if (year%100==0)
  8. year=0;
  9. else if (year%4==0)
  10. year=1;
  11. else
  12. year=0;
  13. return year;
  14. }
  15.  
  16.  
  17.  
  18. int main()
  19. {
  20. int year;
  21. printf("Enter any year: ");
  22. scanf("%d", &year);
  23. if(isLeapYear(year)) {
  24. printf("%d is leap year!\n", year);
  25. } else {
  26. printf("%d is not leap year!\n", year);
  27. }
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment