Guest User

Untitled

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