prog.c:9:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
void main()
^
prog.c: In function ‘main’:
prog.c:16:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i=0;i<n;i++)
^
prog.c:16:2: note: use option -std=c99 or -std=gnu99 to compile your code
prog.c:24:10: error: redefinition of ‘i’
for(int i=0;i<n;i++)
^
prog.c:16:10: note: previous definition of ‘i’ was here
for(int i=0;i<n;i++)
^
prog.c:24:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i=0;i<n;i++)
^