Ghislain_Mike

leap year

May 2nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main ()
  4. {
  5.     int year;
  6.  
  7.     printf ("enter a year want to check:");
  8.     scanf("%d",&year);
  9.  
  10.     if (year % 400==0)
  11.         printf("%d is  a leap year",year);
  12.  
  13.     else if(year % 100 ==0)
  14.  
  15.         printf("%d is not leap year ",year);
  16.  
  17.     else if (year % 4 == 0)
  18.  
  19.             printf("%d is  a leap year",year);
  20.     else
  21.         printf("%d is not leap year ",year);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment