#include<stdio.h> main(){ int Y[2]; int i; printf(""); scanf("%d\n",&Y); for(i=0;i<2;i++){ if(Y[i]%4==0&&Y[i]%100!=0||Y[i]%400==0){ printf("Leap Year\n"); } else{ printf("Not Leap Year\n"); } } /* Main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] main(){ ^~~~ Main.c: In function 'main': Main.c:6:9: warning: zero-length gnu_printf format string [-Wformat-zero-length] printf(""); ^~ Main.c:7:10: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int (*)[2]' [-Wformat=] scanf("%d\n",&Y); ~^ ~~ Main.c:9:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(Y[i]%4==0&&Y[i]%100!=0||Y[i]%400==0){ ~~~~~~~~~^~~~~~~~~~~~~ Main.c:15:2: error: expected declaration or statement at end of input } ^ */ |
Double click to view unformatted code.