#include <stdio.h> void main() { int x,y; if(x<1) printf("%d",x) else if(x<10) printf("%d", 2*x-1); else printf("%d",3*x-11); } /* Main.c:2:6: warning: return type of 'main' is not 'int' [-Wmain] void main() ^ Main.c: In function 'main': Main.c:7:4: error: expected ';' before 'else' else if(x<10) ^ Main.c:4:8: warning: unused variable 'y' [-Wunused-variable] int x,y; ^ */ |
Double click to view unformatted code.