Advertisement
mominulkarim77

Leap Year

Feb 28th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int year;
  5.     scanf("%d",&year);
  6.  
  7.     if (year%4==0)
  8.     {
  9.         if (year%100==0)
  10.         {
  11.             if (year%400==0)
  12.             {
  13.                 printf("Leap Year");
  14.             }
  15.             else
  16.             {
  17.                 printf("Not Leap Year");
  18.             }
  19.         }
  20.         else
  21.         {
  22.                 printf("Leap Year");
  23.         }
  24.     }
  25.  
  26.     else
  27.     {
  28.         printf("Not Leap Year");
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement