Advertisement
RIYAD3403

Untitled

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