Submission #4647387
Source Code Expand
#include<stdio.h> void main(){ char x; scanf("%d",&x); switch (x){ case A: printf("1\n"); case B: printf("2\n"); case C: printf("3\n"); case D: printf("4\n"); case E:printf("5\n"); } return; }
Submission Info
Compile Error
./Main.c: In function ‘main’: ./Main.c:5:9: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘char *’ [-Wformat=] scanf("%d",&x); ^ ./Main.c:8:10: error: ‘A’ undeclared (first use in this function) case A: printf("1\n"); ^ ./Main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in ./Main.c:9:10: error: ‘B’ undeclared (first use in this function) case B: printf("2\n"); ^ ./Main.c:10:10: error: ‘C’ undeclared (first use in this function) case C: printf("3\n"); ^ ./Main.c:11:10: error: ‘D’ undeclared (first use in this function) case D: printf("4\n"); ^ ./Main.c:12:10: error: ‘E’ undeclared (first use in this function) case E:printf("5\n"); ^ ./Main.c:5:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&x); ^