fork download
  1. #include <stdio.h>
  2.  
  3. int input(int a[], int max_n)
  4. {
  5. int i,n;
  6.  
  7. scanf("%d", &n);
  8. if(n>max_n)
  9. n=max_n;
  10. for(i=0;i<n;++i)
  11. scanf("%d", &a[i]);
  12. return n;
  13. }
  14.  
  15. void print(int a[], int n)
  16. {
  17. int i;
  18.  
  19. for(i=0;i<n;++i)
  20. printf("%d ", a[i]);
  21. printf("\n");
  22. }
  23.  
  24. int copy_except(int dst[],int src[],
  25. int n,int v)
  26. {
  27. int i,j;
  28.  
  29. for(i=0;i<n;++i)
  30. if(src[i]!=v)
  31. dst[i]=src[i];
  32. return j;
  33. }
  34.  
  35.  
  36. int main(void)
  37. {
  38. int a[100];
  39. int b[100];
  40. int n,max_n=100;
  41. int v=99;
  42.  
  43. n1=input(a,max_n);
  44. n2=copy_except(b,a,n1,v);
  45. print(b,n);
  46. return 0;
  47. }
  48.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:43:2: error: 'n1' undeclared (first use in this function)
  n1=input(a,max_n);
  ^
prog.c:43:2: note: each undeclared identifier is reported only once for each function it appears in
prog.c:44:2: error: 'n2' undeclared (first use in this function)
  n2=copy_except(b,a,n1,v);
  ^
stdout
Standard output is empty