Advertisement
labib24

Untitled

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