kucheasysa

leap year check

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