prog.c: In function ‘main’:
prog.c:7:13: error: declaration of ‘i’ with no linkage follows extern declaration
int i=20;
^
prog.c:6:20: note: previous declaration of ‘i’ was here
extern int i;
^
prog.c:13:13: error: ‘i’ undeclared (first use in this function)
printf("%d",i);
^
prog.c:13:13: note: each undeclared identifier is reported only once for each function it appears in