View Code of Problem 28

#include <stdio.h>
int main(){
  int y;
  while(scanf("%d",&y) !='EOF'){
    if(y%400 && (y%4==0 && y%100 !=0)
       printf("Leap year");
       else
       printf("Not leap year");
    
  
  }



return 0;
}
/*
Main.c: In function 'main':
Main.c:4:26: warning: multi-character character constant [-Wmultichar]
   while(scanf("%d",&y) !='EOF'){
                          ^
Main.c:6:8: error: expected ')' before 'printf'
        printf("Leap year");
        ^
Main.c:11:3: error: expected expression before '}' token
   }
   ^
*/

Double click to view unformatted code.


Back to problem 28