Language: C

int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}

Compiler output:
main.c: In function 'main':
main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
      |                                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
main.c:1:32: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
      |                                ^~~~~
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:48: error: 'EOF' undeclared (first use in this function)
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
      |                                                ^~~
main.c:1:48: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:1:48: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:127: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
      |                                                                                                                               ^~~~~~
main.c:1:127: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:127: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:127: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:235: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){  if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
      |                                                                                                                                                                                                                                           ^~~~~~
main.c:1:235: note: include '<stdio.h>' or provide a declaration of 'printf'