Language: C

int A[2000];
int m[2000];
int n;

int res(int,int);

int main(){
  int q,i;

  scanf("%d",&n); 
  if(n>N){
    printf("error\n");
    exit(1);
  }
  
  for(i=0 ; i<n ; i++){
    scanf("%d",&A[i]);
  }
  
  scanf("%d",&q);
  if(q>Q){
    printf("error\n");
    exit(2);
  }
  
  for(i=0 ; i<q ; i++){
    scanf("%d",&m[i]);
  }
  
  for(i=0 ; i<q ; i++){
    if(res(0,m[i])==1)printf("yes\n");
  if(res(0,m[i])==0)printf("no\n");
  }
  return 0;
    }

     
int res(int i,int m){
  int result;
  
  if(m == 0)return 1;
  if(i >= n)return 0;
  result = res(i+1,m)||res(i+1,m-A[i]);
  return result;
}


  

Compiler output:
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int A[2000];
main.c:10:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |   scanf("%d",&n);
      |   ^~~~~
main.c:10:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:8: error: 'N' undeclared (first use in this function)
   11 |   if(n>N){
      |        ^
main.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |     printf("error\n");
      |     ^~~~~~
main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   13 |     exit(1);
      |     ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | int A[2000];
main.c:13:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   13 |     exit(1);
      |     ^~~~
main.c:13:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:21:8: error: 'Q' undeclared (first use in this function)
   21 |   if(q>Q){
      |        ^
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   22 |     printf("error\n");
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   23 |     exit(2);
      |     ^~~~
main.c:23:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:31:23: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   31 |     if(res(0,m[i])==1)printf("yes\n");
      |                       ^~~~~~
main.c:31:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   32 |   if(res(0,m[i])==0)printf("no\n");
      |                     ^~~~~~
main.c:32:21: note: include '<stdio.h>' or provide a declaration of 'printf'