Guest User

Untitled

a guest
Nov 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include "stdio.h"
  2.  
  3. int isLeapYear(int year)
  4. {
  5. if(year%4==0){
  6. if(year%100==0){
  7. if(year%400==0){
  8. return 1;
  9. }
  10. return 0;
  11. }
  12. return 1;
  13. }
  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