View Code of Problem 28

# include<stdio.h>
int main(void)
{
  int i;
  while(scanf("%d",i)!=EOF)
  {
    if(i%100!=0$$i%4==0)
    {
      printf("Leap Year");
    }
    else if(i%400==0)
    {
      printf("Leap Year");
    }
    else
      printf("Not Leap Year");
  }
  return 0;
}
/*
Main.c: In function 'main':
Main.c:5:3: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   while(scanf("%d",i)!=EOF)
   ^
Main.c:7:15: error: invalid suffix "$$i" on integer constant
     if(i%100!=0$$i%4==0)
               ^
*/

Double click to view unformatted code.


Back to problem 28