Advertisement
Tahamina_Taha

Check Leap Year

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