prog.c:4:12: error: expected declaration specifiers or ‘...’ before string constant
printf("Enter number of elements in array\n");
^
prog.c:5:11: error: expected declaration specifiers or ‘...’ before string constant
scanf("%d", &n);
^
prog.c:5:17: error: expected declaration specifiers or ‘...’ before ‘&’ token
scanf("%d", &n);
^
prog.c:7:12: error: expected declaration specifiers or ‘...’ before string constant
printf("Enter %d elements\n", n);
^
prog.c:7:35: error: expected declaration specifiers or ‘...’ before ‘n’
printf("Enter %d elements\n", n);
^
prog.c:9:5: error: expected identifier or ‘(’ before ‘for’
for (c = 0; c < n; c++)
^
prog.c:9:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
for (c = 0; c < n; c++)
^
prog.c:9:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘++’ token
for (c = 0; c < n; c++)
^
prog.c:13:12: error: expected declaration specifiers or ‘...’ before string constant
printf("Enter the location where you wish to insert an element\n");
^
prog.c:14:11: error: expected declaration specifiers or ‘...’ before string constant
scanf("%d", &position);
^
prog.c:14:17: error: expected declaration specifiers or ‘...’ before ‘&’ token
scanf("%d", &position);
^
prog.c:16:12: error: expected declaration specifiers or ‘...’ before string constant
printf("Enter the value to insert\n");
^
prog.c:17:11: error: expected declaration specifiers or ‘...’ before string constant
scanf("%d", &value);
^
prog.c:17:17: error: expected declaration specifiers or ‘...’ before ‘&’ token
scanf("%d", &value);
^
prog.c:19:5: error: expected identifier or ‘(’ before ‘for’
for (c = n - 1; c >= position - 1; c--)
^
prog.c:19:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘>=’ token
for (c = n - 1; c >= position - 1; c--)
^
prog.c:19:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token
for (c = n - 1; c >= position - 1; c--)
^
prog.c:23:5: warning: data definition has no type or storage class [enabled by default]
array[position-1] = value;
^
prog.c:23:5: warning: type defaults to ‘int’ in declaration of ‘array’ [-Wimplicit-int]
prog.c:23:5: error: variably modified ‘array’ at file scope
prog.c:23:5: error: conflicting types for ‘array’
prog.c:2:5: note: previous declaration of ‘array’ was here
int array[100], position, c, n, value;
^
prog.c:23:5: error: invalid initializer
array[position-1] = value;
^
prog.c:25:12: error: expected declaration specifiers or ‘...’ before string constant
printf("Resultant array is\n");
^
prog.c:27:5: error: expected identifier or ‘(’ before ‘for’
for (c = 0; c <= n; c++)
^
prog.c:27:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<=’ token
for (c = 0; c <= n; c++)
^
prog.c:27:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘++’ token
for (c = 0; c <= n; c++)
^
prog.c:30:5: error: expected identifier or ‘(’ before ‘return’
return 0;
^