S.c:4:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
void main()
^
S.c: In function ‘main’:
S.c:20:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < N; i++)
^
S.c:20:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
S.c:22:11: error: redefinition of ‘i’
for (int i = 0; i < M; i++)
^
S.c:20:11: note: previous definition of ‘i’ was here
for (int i = 0; i < N; i++)
^
S.c:22:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < M; i++)
^
S.c:24:11: error: redefinition of ‘i’
for (int i = 0; i < K; i++)
^
S.c:22:11: note: previous definition of ‘i’ was here
for (int i = 0; i < M; i++)
^
S.c:24:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < K; i++)
^
S.c:27:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int y = 0; y < K; y++)
^
S.c:33:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; (i < N) && (toggle == 0); i++)
^
S.c:37:13: error: redefinition of ‘i’
for (int i = 0; (i < M) && (toggle == 0); i++)
^
S.c:33:13: note: previous definition of ‘i’ was here
for (int i = 0; (i < N) && (toggle == 0); i++)
^
S.c:37:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; (i < M) && (toggle == 0); i++)
^
S.c: At top level:
S.c:51:1: error: expected identifier or ‘(’ before ‘}’ token
}
^
S.c: In function ‘main’:
S.c:15:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d", &N, &M, &K);
^
S.c:21:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &p[i]);
^
S.c:23:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &q[i]);
^
S.c:25:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &k[i]);
^