Advertisement
inhuman_Arif

Leap year

Apr 2nd, 2020
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main()
  4. {
  5.     int year;
  6.     printf("Enter Year: ");
  7.     scanf("%d",&year);
  8.     if(year%4==0 && year%100!=0)
  9.     {
  10.         printf("Leap year\n");
  11.     }
  12.     else if(year%400==0)
  13.     {
  14.         printf("Leap year\n");
  15.     }
  16.     else
  17.     {
  18.         printf("Common year\n");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement