fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7. if(n%4!=0)
  8. printf("not a leap year");
  9. else if(n%400==0)
  10. printf("leap year");
  11. else if(n%100==0)
  12. printf("not a leap year");
  13. else
  14. printf("leap year");
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5312KB
stdin
1900
stdout
Enter the number: not a leap year