criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <malloc.h>

void insertionSort(int *A, int N) // N??????????´??????????0-?????????????????????A
{
    int i,j,v;

    for(i=1; i<N; i++){// ??? 1 ?????? N-1 ?????§
        v = A[i];
        j = i - 1
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j]
            j--;
        }
        A[j+1] = v;
        for (j=0; j<N; j++)
            printf("%d ", A[j]);
        printf("\n");
    }
}

char Arg[1024];
int main(void)
{
    int i,j,k,N, *Array; char work[5];

    scanf("%d", &N);
    Array=malloc(N*sizeof(int));
    if (Array==NULL)
        return -1;
    scanf("%s", Arg);
    for(i=j=k=0; Arg[i]; Arg[j]){
        for (j=i; Arg[j]!=' ' && !Arg[j]; j++);
        strcpy(work, &Arg[i], j-i);
        Array[k++]=atoi(work);
    }
    insertionSort(Array, N);
}

Compiler output:
main.c: In function 'insertionSort':
main.c:10:18: error: expected ';' before 'while'
   10 |         j = i - 1
      |                  ^
      |                  ;
   11 |         while(j >= 0 && A[j] > v){
      |         ~~~~~     
main.c: In function 'main':
main.c:34:9: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
   34 |         strcpy(work, &Arg[i], j-i);
      |         ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcpy'
    2 | #include <malloc.h>
  +++ |+#include <string.h>
    3 | 
main.c:34:9: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
   34 |         strcpy(work, &Arg[i], j-i);
      |         ^~~~~~
main.c:34:9: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c:34:9: error: too many arguments to function 'strcpy'
main.c:35:20: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   35 |         Array[k++]=atoi(work);
      |                    ^~~~
Language: C

#include <stdio.h>
#include <malloc.h>

void insertionSort(int *A, int N) // N??????????´??????????0-?????????????????????A
{
    int i,j,v;

    for(i=1; i<N; i++){// ??? 1 ?????? N-1 ?????§
        v = A[i];
        j = i - 1
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        for (j=0; j<N; j++)
            printf("%d ", A[j]);
        printf("\n");
    }
}

char Arg[1024];
int main(void)
{
    int i,j,k,N, *Array; char work[5];

    scanf("%d", &N);
    Array=malloc(N*sizeof(int));
    if (Array==NULL)
        return -1;
    scanf("%s", Arg);
    for(i=j=k=0; Arg[i]; Arg[j]){
        for (j=i; Arg[j]!=' ' && !Arg[j]; j++);
        strncpy(work, &Arg[i], j-i);
        Array[k++]=atoi(work);
    }
    insertionSort(Array, N);
}

Compiler output:
main.c: In function 'insertionSort':
main.c:10:18: error: expected ';' before 'while'
   10 |         j = i - 1
      |                  ^
      |                  ;
   11 |         while(j >= 0 && A[j] > v){
      |         ~~~~~     
main.c: In function 'main':
main.c:34:9: error: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
   34 |         strncpy(work, &Arg[i], j-i);
      |         ^~~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strncpy'
    2 | #include <malloc.h>
  +++ |+#include <string.h>
    3 | 
main.c:34:9: warning: incompatible implicit declaration of built-in function 'strncpy' [-Wbuiltin-declaration-mismatch]
   34 |         strncpy(work, &Arg[i], j-i);
      |         ^~~~~~~
main.c:34:9: note: include '<string.h>' or provide a declaration of 'strncpy'
main.c:35:20: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   35 |         Array[k++]=atoi(work);
      |                    ^~~~
Language: C

#include <stdio.h>
#include <malloc.h>

void insertionSort(int *A, int N) // N??????????´??????????0-?????????????????????A
{
    int i,j,v;

    for(i=1; i<N; i++){// ??? 1 ?????? N-1 ?????§
        v = A[i];
        j = i - 1;
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        for (j=0; j<N; j++)
            printf("%d ", A[j]);
        printf("\n");
    }
}

char Arg[1024];
int main(void)
{
    int i,j,k,N, *Array; char work[5];

    scanf("%d", &N);
    Array=malloc(N*sizeof(int));
    if (Array==NULL)
        return -1;
    scanf("%s", Arg);
    for(i=j=k=0; Arg[i]; Arg[j]){
        for (j=i; Arg[j]!=' ' && !Arg[j]; j++);
        strncpy(work, &Arg[i], j-i);
        Array[k++]=atoi(work);
    }
    insertionSort(Array, N);
    mfree(Array);
}

Compiler output:
main.c: In function 'main':
main.c:34:9: error: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
   34 |         strncpy(work, &Arg[i], j-i);
      |         ^~~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strncpy'
    2 | #include <malloc.h>
  +++ |+#include <string.h>
    3 | 
main.c:34:9: warning: incompatible implicit declaration of built-in function 'strncpy' [-Wbuiltin-declaration-mismatch]
   34 |         strncpy(work, &Arg[i], j-i);
      |         ^~~~~~~
main.c:34:9: note: include '<string.h>' or provide a declaration of 'strncpy'
main.c:35:20: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   35 |         Array[k++]=atoi(work);
      |                    ^~~~
main.c:38:5: error: implicit declaration of function 'mfree'; did you mean 'free'? [-Wimplicit-function-declaration]
   38 |     mfree(Array);
      |     ^~~~~
      |     free
Language: C

#include<stdio.h.
int main()
{
	int i,j,k,x,key;
	scanf("%d",&x);
	int a[x];
	for(i=0; i<x; i++){
		scanf("%d",&a[i]);
	}
	for(i=1; i<6; i++)
	{
		key=a[i];
		j=i-1;
		while(j>=0 && key<a[j])
		{
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
		for(k=0; k<5; k++) printf("%d ",a[k]);
		printf("%d\n",a[6]);
	}
	return 0;
}
	

Compiler output:
main.c:1:18: error: missing terminating > character
    1 | #include<stdio.h.
      |                  ^
main.c:1:9: fatal error: stdio.h.: No such file or directory
    1 | #include<stdio.h.
      |         ^
compilation terminated.
Language: C

#include <stdio.h>

int isort(int n, int a[]){
	int i,j;
	for(i = 1; i < n+1; i++){
		v = a[i];
		j = i-1;
		while(j <= 0 && a[j] > v){
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = v;
	}
}

int main(){
	int n;
	int a[100];
	scanf("%d",&n);
	for(i = 0; i < n; i++)
		scanf("%d",a)
	isort(n,a);
}

Compiler output:
main.c: In function 'isort':
main.c:6:17: error: 'v' undeclared (first use in this function)
    6 |                 v = a[i];
      |                 ^
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:20:13: error: 'i' undeclared (first use in this function)
   20 |         for(i = 0; i < n; i++)
      |             ^
main.c:21:30: error: expected ';' before 'isort'
   21 |                 scanf("%d",a)
      |                              ^
      |                              ;
   22 |         isort(n,a);
      |         ~~~~~
Language: C

 #include<stdio.h>

int main() {
   int n,i;
   int A[1000];
 
   scanf("%d",&n);
   for (i=0; i<n; i++) {
       v=A[i];
       j=i-1;
      while (j>=0 || A[j]>v) {
        A[+1j]=A[j];
        j--
      A[j+1]=v;
      }
   }
   return 0;

}

Compiler output:
main.c: In function 'main':
main.c:9:8: error: 'v' undeclared (first use in this function)
    9 |        v=A[i];
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:8: error: 'j' undeclared (first use in this function)
   10 |        j=i-1;
      |        ^
main.c:12:10: error: array subscript is not an integer
   12 |         A[+1j]=A[j];
      |          ^
main.c:13:12: error: expected ';' before 'A'
   13 |         j--
      |            ^
      |            ;
   14 |       A[j+1]=v;
      |       ~
Language: C

 #include<stdio.h>

int main() {
   int n,i,j,v;
   int A[1000];
 
   scanf("%d",&n);
   for (i=0; i<n; i++) {
       v=A[i];
       j=i-1;
      while (j>=0 || A[j]>v) {
        A[+1j]=A[j];
        j--;
      A[j+1]=v;
      }
   }
   return 0;

}

Compiler output:
main.c: In function 'main':
main.c:12:10: error: array subscript is not an integer
   12 |         A[+1j]=A[j];
      |          ^
Language: C

#include<stdio.h>

int main() {
	int n,i,j,v,k;
	int A[1000];

	scanf("%d",&n);

	for (i=0; i<n; i++)
	   scanf("%d",&A[i]);

	for (i=0; i<n; i++) {
			v=A[i];
			j=i-1;
		 while (j>=0 && A[j]>v) {
			 A[j+1]=A[j];
			 j--;
		 A[j+1]=v;
		 }
	for (k=0; n<k-1; k) 
           printf("%d ",A[k]);
        printf("%d",A[k+1]
        
  printf("\n");
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:22:27: error: expected ')' before 'printf'
   22 |         printf("%d",A[k+1]
      |               ~           ^
      |                           )
   23 | 
   24 |   printf("\n");
      |   ~~~~~~                   
main.c:24:16: error: expected ';' before '}' token
   24 |   printf("\n");
      |                ^
      |                ;
   25 |         }
      |         ~
Language: C

#include<stdio.h>

int main() {
	int n,i,j,v,k;
	int A[1000];

	scanf("%d",&n);

	for (i=0; i<n; i++)
	   scanf("%d",&A[i]);

	for (i=0; i<n; i++) {
			v=A[i];
			j=i-1;
		 while (j>=0 && A[j]>v) {
			 A[j+1]=A[j];
			 j--;
		 A[j+1]=v;
		 }
	for (k=0; n<k-1; k) 
           printf("%d ",A[k]);
        printf("%d",A[k+1])
        
  printf("\n");
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:22:28: error: expected ';' before 'printf'
   22 |         printf("%d",A[k+1])
      |                            ^
      |                            ;
   23 | 
   24 |   printf("\n");
      |   ~~~~~~
Language: C

#include <stdio.h>

int insertionSort (int A[], int N)
{
   int i, j, v

   for (i = 0; i < N-1; i++) {
      v = A[i];
      j = i - 1;

      while (j >= 0 && A[i] > v) {
         A[j + i] = A[j];
         j--;
      }
      A[j + 1] = v;
   }

   return 

Compiler output:
main.c: In function 'insertionSort':
main.c:7:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    7 |    for (i = 0; i < N-1; i++) {
      |    ^~~
main.c:7:28: error: expected ';' before ')' token
    7 |    for (i = 0; i < N-1; i++) {
      |                            ^
      |                            ;
main.c:7:28: error: expected statement before ')' token
main.c:8:7: error: 'v' undeclared (first use in this function)
    8 |       v = A[i];
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:4: error: expected expression at end of input
   18 |    return
      |    ^~~~~~
main.c:18:4: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>

int main(){
 int N, minj;
 int A[];
 int i, j, temp;
 int c=0;
 int n, k=0;

 scanf("%d\n", &N);
 while(N>=0){
    scanf("%d\n, &A[n])
      n++;
 }

 for(i=1;i<N;i++){
      v=A[i];
      
      j=i-1;
    while(j>=0 && A[j]>v){
        A[j+1]=a[j];
         j--;
        A[j+1]=v;     
      }
 }
 

 
 printf("%d \n", A[]);

 
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:5:6: error: array size missing in 'A'
    5 |  int A[];
      |      ^
main.c:12:11: warning: missing terminating " character
   12 |     scanf("%d\n, &A[n])
      |           ^
main.c:12:11: error: missing terminating " character
   12 |     scanf("%d\n, &A[n])
      |           ^~~~~~~~~~~~~
main.c:13:10: error: expected ')' before ';' token
   13 |       n++;
      |          ^
      |          )
main.c:12:10: note: to match this '('
   12 |     scanf("%d\n, &A[n])
      |          ^
main.c:13:8: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
   13 |       n++;
      |       ~^~
      |        |
      |        int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:13:11: error: expected ';' before '}' token
   13 |       n++;
      |           ^
      |           ;
   14 |  }
      |  ~         
main.c:17:7: error: 'v' undeclared (first use in this function)
   17 |       v=A[i];
      |       ^
main.c:17:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:16: error: 'a' undeclared (first use in this function)
   21 |         A[j+1]=a[j];
      |                ^
main.c:29:20: error: expected expression before ']' token
   29 |  printf("%d \n", A[]);
      |                    ^
Language: C

#include<stdio.h>

 int main()
 {
   int i , j, b, v, k, A[200];
   scanf("%d",&b);
   for(i=0; i < b; i++){
    scanf("%d",&A[i]);
   }
   
   for(i=1; i < b; i++){
    v = A[i];
    j = i - 1;
    for(k = 1; k < b; k++){
????????????if(k > 1){
      printf(" ");
     }
????????????printf("%d", A[k-1]);
????????}
   printf("\n");
    while(j >= 0 && A[j] > v){
     A[j+1] = A[j];
     j--;
    A[j+1] = v;
    }
   }
        for(k=1; k <= b; k++){
????????????if(k > 1){
      printf(" ");
     }
????????????printf("%d", A[k-1]);
????????}
    printf("\n");
    
   return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:15:1: error: expected expression before '?' token
   15 | ????????????if(k > 1){
      | ^
main.c:19:1: error: expected expression before '?' token
   19 | ????????}
      | ^
main.c:28:1: error: expected expression before '?' token
   28 | ????????????if(k > 1){
      | ^
main.c:32:1: error: expected expression before '?' token
   32 | ????????}
      | ^
Language: C

#include<stdio.h>

int main(void)
{
  int i,j,v,a[],n,;

  scanf("%d",&n);
  for(i=0; i<n; i++) {
    scanf("%d",&a[i]);
    }
  for(i=0; i<n; i++) {
    printf("%d",a[i]);
    v = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > v) {
      a[j+1] = a[j];
      j--;
    a[j+1] = v;
    printf("%d ",a[i]);
    printf("\n");
    }
  }
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 'a'
    5 |   int i,j,v,a[],n,;
      |             ^
main.c:5:19: error: expected identifier or '(' before ';' token
    5 |   int i,j,v,a[],n,;
      |                   ^
Language: C

#include<stdio.h>

int main(void)
{
  int i,j,v,a[],n,;

  scanf("%d",&n);
  for(i=0; i < n; i++) {
    scanf("%d",&a[i]);
    }
  for(i=0; i < n; i++) {
    printf("%d",a[i]);
    v = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > v) {
      a[j+1] = a[j];
      j--;
    a[j+1] = v;
    printf("%d ",a[i]);
    printf("\n");
    }
  }
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 'a'
    5 |   int i,j,v,a[],n,;
      |             ^
main.c:5:19: error: expected identifier or '(' before ';' token
    5 |   int i,j,v,a[],n,;
      |                   ^
Language: C

#include<stdio.h>

int main(void)
{
  int i, j, v, A[], n;

  scanf("%d",&n);
  for(i=0; i < n; i++){
    scanf("%d",&A[i]);
    }
  for(i=0; i < n; i++){
    printf("%d",A[i]);
    v = A[i];
    j = i - 1;
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    A[j+1] = v;
    printf("%d ",A[i]);
    printf("\n");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:16: error: array size missing in 'A'
    5 |   int i, j, v, A[], n;
      |                ^
Language: C

#include<stdio.h>

void insertionsort(A,N){
		int i,j;
		for(i=1;i<=N-1;i++){
			v = A[i];
			j = i-1;
			while(j>=0&&A[j]>v){
				A[j+1]=A[j];
				j--;
				A[j+1]=v;
				
			}
			for(i=0;i<N;i++){
			printf("%d",A[i]);
			}
		}
}
	





int main(){
  int n,A[1000];
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  insertionsort(A,n)

  return 0;
}

Compiler output:
main.c: In function 'insertionsort':
main.c:3:6: error: type of 'A' defaults to 'int' [-Wimplicit-int]
    3 | void insertionsort(A,N){
      |      ^~~~~~~~~~~~~
main.c:3:6: error: type of 'N' defaults to 'int' [-Wimplicit-int]
main.c:6:25: error: 'v' undeclared (first use in this function)
    6 |                         v = A[i];
      |                         ^
main.c:6:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:30: error: subscripted value is neither array nor pointer nor vector
    6 |                         v = A[i];
      |                              ^
main.c:8:38: error: subscripted value is neither array nor pointer nor vector
    8 |                         while(j>=0&&A[j]>v){
      |                                      ^
main.c:9:34: error: subscripted value is neither array nor pointer nor vector
    9 |                                 A[j+1]=A[j];
      |                                  ^
main.c:9:41: error: subscripted value is neither array nor pointer nor vector
    9 |                                 A[j+1]=A[j];
      |                                         ^
main.c:11:34: error: subscripted value is neither array nor pointer nor vector
   11 |                                 A[j+1]=v;
      |                                  ^
main.c:15:38: error: subscripted value is neither array nor pointer nor vector
   15 |                         printf("%d",A[i]);
      |                                      ^
main.c: In function 'main':
main.c:29:7: error: 'i' undeclared (first use in this function)
   29 |   for(i=0;i<n;i++){
      |       ^
main.c:33:21: error: expected ';' before 'return'
   33 |   insertionsort(A,n)
      |                     ^
      |                     ;
   34 | 
   35 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>

void insertionsort(A,N){
		int i,j,v;
		for(i=1;i<=N-1;i++){
			v = A[i];
			j = i-1;
			while(j>=0&&A[j]>v){
				A[j+1]=A[j];
				j--;
				A[j+1]=v;
				
			}
			for(i=0;i<N;i++){
			printf("%d",A[i]);
			}
		}
}
	





int main(){
  int n,A[1000];
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  insertionsort(A,n)

  return 0;
}

Compiler output:
main.c: In function 'insertionsort':
main.c:3:6: error: type of 'A' defaults to 'int' [-Wimplicit-int]
    3 | void insertionsort(A,N){
      |      ^~~~~~~~~~~~~
main.c:3:6: error: type of 'N' defaults to 'int' [-Wimplicit-int]
main.c:6:30: error: subscripted value is neither array nor pointer nor vector
    6 |                         v = A[i];
      |                              ^
main.c:8:38: error: subscripted value is neither array nor pointer nor vector
    8 |                         while(j>=0&&A[j]>v){
      |                                      ^
main.c:9:34: error: subscripted value is neither array nor pointer nor vector
    9 |                                 A[j+1]=A[j];
      |                                  ^
main.c:9:41: error: subscripted value is neither array nor pointer nor vector
    9 |                                 A[j+1]=A[j];
      |                                         ^
main.c:11:34: error: subscripted value is neither array nor pointer nor vector
   11 |                                 A[j+1]=v;
      |                                  ^
main.c:15:38: error: subscripted value is neither array nor pointer nor vector
   15 |                         printf("%d",A[i]);
      |                                      ^
main.c: In function 'main':
main.c:29:7: error: 'i' undeclared (first use in this function)
   29 |   for(i=0;i<n;i++){
      |       ^
main.c:29:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:21: error: expected ';' before 'return'
   33 |   insertionsort(A,n)
      |                     ^
      |                     ;
   34 | 
   35 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>
int main(void){
  int i,j;
  int N;
  int v;
  int a[200];
  scanf("%d",&n);
  for(i=0;i<N;i++)  scanf("%d",&a[i]);
  for(i=0;i<N;i++)  printf("%d ",a[i]);
  printf("\n");
  for(i=1;i<N-1;i++){
    v=a[i];
    j=i-1;
    while(j>=0 && a[j]>v){
      a[j+1]=a[j];
      j--;
      a[j+1]=v;
    }
    for(i=0;i<N;i++)  printf("%d ",a[i]);
    printf("\n");
  }


  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d",&n);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

void insertionsort(int *A,int N){
		int i,j,v;
		for(i=1;i<=N-1;i++){
			v = A[i];
			j = i-1;
			while(j>=0&&A[j]>v){
				A[j+1]=A[j];
				j--;
				A[j+1]=v;
				
			}
			for(i=0;i<N;i++){
			printf("%d",A[i]);
			}
		}
}
	





int main(){
  int n,A[1000];
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  insertionsort(A,n)

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:7: error: 'i' undeclared (first use in this function)
   29 |   for(i=0;i<n;i++){
      |       ^
main.c:29:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:21: error: expected ';' before 'return'
   33 |   insertionsort(A,n)
      |                     ^
      |                     ;
   34 | 
   35 |   return 0;
      |   ~~~~~~
Language: C

#include <stdio.h>
int main(){
    int n,i,j,k;
    int str[100]
    int max;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&str[i]);
    for(k=0;k<n-1;k++)
        printf("%d ",str[k]);
    printf("%d\n",str[k]);
    for(i=1;i<n;i++){
        max=str[i];
        
        for(j=i-1;j>=0 && str[j]>max;j--)
            str[j+1]=str[j];
        str[j+1]=max;
        for(k=0;k<n-1;k++) printf("%d ",str[k]);
        printf("%d\n",str[k]);
    }
    system("pause");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:17: error: expected ';' before 'int'
    4 |     int str[100]
      |                 ^
      |                 ;
    5 |     int max;
      |     ~~~          
main.c:8:21: error: 'str' undeclared (first use in this function)
    8 |         scanf("%d",&str[i]);
      |                     ^~~
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:5: error: implicit declaration of function 'system' [-Wimplicit-function-declaration]
   21 |     system("pause");
      |     ^~~~~~
Language: C

#include<stdio.h>

void insertionsort(int *A,int N){
		int i,j,v;
		for(i=1;i<N-1;i++){
			v = A[i];
			j = i-1;
			while(j>=0&&A[j]>v){
				A[j+1]=A[j];
				j--;
				A[j+1]=v;
				
			}
			for(i=0;i<N;i++){
			printf("%d\n",A[i]);
			}
		}
}
	[]:
	





int main(){
  int n,i,A[1000];
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  insertionsort(A,n);

  return 0;
}

Compiler output:
main.c:19:9: error: expected identifier or '(' before '[' token
   19 |         []:
      |         ^
Language: C

#include<stdio.h>

void insertionsort(int *A,int N){
		int i,j,v;
		for(i=1;i<N-1;i++){
			v = A[i];
			j = i-1;
			while(j>=0&&A[j]>v){
				A[j+1]=A[j];
				j--;
				A[j+1]=v;
				
			}
			for(i=0;i<N;i++){
			printf("%d",A[i]);
			}
			printf("\n")
		}
}
	
	





int main(){
  int n,i,A[1000];
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  insertionsort(A,n);

  return 0;
}

Compiler output:
main.c: In function 'insertionsort':
main.c:17:37: error: expected ';' before '}' token
   17 |                         printf("\n")
      |                                     ^
      |                                     ;
   18 |                 }
      |                 ~
Language: C

int main(void){
   int N,n,i,j,v;
   int array[100];
   scanf("%d",&N);
   for(i=0;i<N;i++){
      scanf("%d",&n);
      array[i] = n;
   }
	for(j=0;j<N-1;j++){
			printf("%d ",A[j]);
		}
	printf("%d\n",A[j]);
	for(i=1;i<N-1;i++){
		v = A[i];
		j = i-1;
		while(j>=0&&A[j]>v){
			A[j+1] = A[j];
			j--;
			A[j+1] = v;
		}
		for(j=0;j<N-1;j++){
			printf("%d ",A[j]);
		}
		printf("%d\n",A[j]);
	}
}

Compiler output:
main.c: In function 'main':
main.c:4:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |    scanf("%d",&N);
      |    ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:4:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |    scanf("%d",&N);
      |    ^~~~~
main.c:4:4: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |                         printf("%d ",A[j]);
      |                         ^~~~~~
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:38: error: 'A' undeclared (first use in this function)
   10 |                         printf("%d ",A[j]);
      |                                      ^
main.c:10:38: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 |         printf("%d\n",A[j]);
      |         ^~~~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main(void){
   int N,n,i,j,k;v;
   int A[100];
   scanf("%d",&N);
	
   for(i=0;i<N;i++){
      scanf("%d",&n);
      A[i] = n;
   }
	
	for(k=0;k<N-1;k++){
			printf("%d ",A[k]);
		}
	printf("%d\n",A[j]);
	
	for(i=1;i<N-1;i++){
		v = A[i];
		j = i-1;
		while(j>=0&&A[j]>v){
			A[j+1] = A[j];
			j--;
			A[j+1] = v;
		}
		for(k=0;k<N-1;k++){
			printf("%d ",A[k]);
		}
		printf("%d\n",A[k]);
	}
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: 'v' undeclared (first use in this function)
    4 |    int N,n,i,j,k;v;
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio,h>

void trace(intA[], int N){

  int vi;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N):
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c:1:9: fatal error: stdio,h: No such file or directory
    1 | #include<stdio,h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio,h>

void trace(intA[], int N){

  int v;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N):
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c:1:9: fatal error: stdio,h: No such file or directory
    1 | #include<stdio,h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

void trace(intA[], int N){

  int v;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N):
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c:3:12: error: unknown type name 'intA'; did you mean 'int'?
    3 | void trace(intA[], int N){
      |            ^~~~
      |            int
main.c: In function 'insertionsort':
main.c:23:3: error: implicit declaration of function 'trace' [-Wimplicit-function-declaration]
   23 |   trace(A, N);
      |   ^~~~~
main.c: In function 'main':
main.c:31:18: error: expected ';' before ':' token
   31 |   scanf("%d", &N):
      |                  ^
      |                  ;
main.c:35:3: error: implicit declaration of function 'insertionSort'; did you mean 'insertionsort'? [-Wimplicit-function-declaration]
   35 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
      |   insertionsort
Language: C

#include<stdio.h>

void trace(int A[], int N){

  int v;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N):
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c: In function 'trace':
main.c:6:8: error: 'i' undeclared (first use in this function)
    6 |   for( i = 0; i < N; i++){
      |        ^
main.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:31:18: error: expected ';' before ':' token
   31 |   scanf("%d", &N):
      |                  ^
      |                  ;
main.c:35:3: error: implicit declaration of function 'insertionSort'; did you mean 'insertionsort'? [-Wimplicit-function-declaration]
   35 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
      |   insertionsort
Language: C

#include<stdio.h>

void trace(int A[], int N){

  int i;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N):
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:18: error: expected ';' before ':' token
   31 |   scanf("%d", &N):
      |                  ^
      |                  ;
main.c:35:3: error: implicit declaration of function 'insertionSort'; did you mean 'insertionsort'? [-Wimplicit-function-declaration]
   35 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
      |   insertionsort
Language: C

#include<stdio.h>

void trace(int A[], int N){

  int i;
  for( i = 0; i < N; i++){
  if( i > 0) printf(" ");
  printf("%d", A[i]);
  }
 printf("\n");
}

void insertionsort(int A[], int N){
  int i, j, v;
  for( i = 1; i < N; i++){
   v = A[i];
   j = i - 1;
  while( j >= 0 && A[j] > v){
   A[j+1] =A[j];
   j--;
  }
  A[j+1] = v;
  trace(A, N);
 }
}

int main(){
  int N, i, j;
  int A[100];

  scanf("%d", &N);
  for( i = 0; i < N; i++) scanf("%d", &A[i]);

  trace(A, N);
  insertionSort(A, N);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:3: error: implicit declaration of function 'insertionSort'; did you mean 'insertionsort'? [-Wimplicit-function-declaration]
   35 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
      |   insertionsort
Language: C

#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)
			printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int i,j,v,
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

ina main(){
	int i,j,N=[100];
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);

	trace(A,N);
	insertionSort(A,N);

	return 0;
}

Compiler output:
main.c: In function 'insertionSort':
main.c:15:9: error: expected identifier or '(' before 'for'
   15 |         for(i=1;i<N;i++){
      |         ^~~
main.c:15:24: error: expected ';' before ')' token
   15 |         for(i=1;i<N;i++){
      |                        ^
      |                        ;
main.c:15:24: error: expected statement before ')' token
main.c: At top level:
main.c:27:1: error: unknown type name 'ina'; did you mean 'int'?
   27 | ina main(){
      | ^~~
      | int
main.c: In function 'main':
main.c:28:19: error: expected expression before '[' token
   28 |         int i,j,N=[100];
      |                   ^
main.c:31:29: error: 'A' undeclared (first use in this function)
   31 |                 scanf("%d",&A[i]);
      |                             ^
main.c:31:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)
			printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

ina main(){
	int i,j,N=[100];
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);

	trace(A,N);
	insertionSort(A,N);

	return 0;
}

Compiler output:
main.c:27:1: error: unknown type name 'ina'; did you mean 'int'?
   27 | ina main(){
      | ^~~
      | int
main.c: In function 'main':
main.c:28:19: error: expected expression before '[' token
   28 |         int i,j,N=[100];
      |                   ^
main.c:31:29: error: 'A' undeclared (first use in this function)
   31 |                 scanf("%d",&A[i]);
      |                             ^
main.c:31:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)
			printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

int main(){
	int i,j,N=[100];
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);

	trace(A,N);
	insertionSort(A,N);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:19: error: expected expression before '[' token
   28 |         int i,j,N=[100];
      |                   ^
main.c:31:29: error: 'A' undeclared (first use in this function)
   31 |                 scanf("%d",&A[i]);
      |                             ^
main.c:31:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)
			printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

int main(){
	int i,j,N,A=[100];
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);

	trace(A,N);
	insertionSort(A,N);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:21: error: expected expression before '[' token
   28 |         int i,j,N,A=[100];
      |                     ^
main.c:31:30: error: subscripted value is neither array nor pointer nor vector
   31 |                 scanf("%d",&A[i]);
      |                              ^
main.c:33:15: error: passing argument 1 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   33 |         trace(A,N);
      |               ^
      |               |
      |               int
main.c:3:16: note: expected 'int *' but argument is of type 'int'
    3 | void trace(int A[],int N){
      |            ~~~~^~~
main.c:34:23: error: passing argument 1 of 'insertionSort' makes pointer from integer without a cast [-Wint-conversion]
   34 |         insertionSort(A,N);
      |                       ^
      |                       |
      |                       int
main.c:13:24: note: expected 'int *' but argument is of type 'int'
   13 | void insertionSort(int A[],int N){
      |                    ~~~~^~~
Language: C

#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)
			printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

int main(){
	int i,j,N;
	int A=[100];
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);

	trace(A,N);
	insertionSort(A,N);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:15: error: expected expression before '[' token
   29 |         int A=[100];
      |               ^
main.c:32:30: error: subscripted value is neither array nor pointer nor vector
   32 |                 scanf("%d",&A[i]);
      |                              ^
main.c:34:15: error: passing argument 1 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   34 |         trace(A,N);
      |               ^
      |               |
      |               int
main.c:3:16: note: expected 'int *' but argument is of type 'int'
    3 | void trace(int A[],int N){
      |            ~~~~^~~
main.c:35:23: error: passing argument 1 of 'insertionSort' makes pointer from integer without a cast [-Wint-conversion]
   35 |         insertionSort(A,N);
      |                       ^
      |                       |
      |                       int
main.c:13:24: note: expected 'int *' but argument is of type 'int'
   13 | void insertionSort(int A[],int N){
      |                    ~~~~^~~
Language: C

#include <stdio.h>
#define SIZE 100
int main(void){
	int array[SIZE], i, j, work, index, N;
	char str[6]
	
	fscanf(stdin, "%d", &N);
	
	p = array;
	while (p < array +N) fscanf(sddin, "%d", p++);
	
	i = 1;
	while (i < N) {
		work = array[i];
		j = i -1;
		while (j >= 0 && array > work) array[j +1] = array[j--];
		array[j +1] = work;
		
		// output stdout
		p = array;
		while (p < array +N) fprintf(stdout, "%d ", *p++);
		
		i++;
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fscanf'
    7 |         fscanf(stdin, "%d", &N);
      |         ^~~~~~
main.c:9:9: error: 'p' undeclared (first use in this function)
    9 |         p = array;
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:37: error: 'sddin' undeclared (first use in this function); did you mean 'stdin'?
   10 |         while (p < array +N) fscanf(sddin, "%d", p++);
      |                                     ^~~~~
      |                                     stdin
main.c:16:40: warning: comparison between pointer and integer
   16 |                 while (j >= 0 && array > work) array[j +1] = array[j--];
      |                                        ^
Language: C

#include <stdio.h>
void sort_insert_down(int* a,int len)  
{  
    int i = 0;  
       int j = 0;  
       int k = 0;  
       int temp = 0;  
         
       for(i=1;i<len;i++)  
       {  
           k = i;  
           temp = a[k];  
          
           for(j=i-1;j>=0;j--)  
           {  
               if(a[j]<temp)  
               {  
                   a[j+1] = a[j];  
                   k = j;  //??°????§???¨?????????   
               }     
           }     
           a[k] = temp;//?????\   
       }  
   }  
   //--------------------------------------------------------------------  
   int main(int argc, char *argv[])   
   {  
       int array[10] = {0};  
       int index = 0;  
       int i = 0;  
       printf("please input 10 number!\n");  
       while((scanf("%d",&array[index]) != EOF)&&(getchar()!='\n'))  
       {  
           index++;      
       }  
         
       printf("index = %d\n",index);  
         
       for(i=0;i<=index;i++)  
       {  
           printf("%dth : %d\n",i,array[i]);     
       }  
             
       printf("down   \n");  
       sort_insert_down(array,index+1);  
       for(i=0;i<=index;i++)  
       {  
           printf("%dth : %d\n",i,array[i]);     
       }  
         
       printf("up   \n");  
       sort_insert_up(array,index+1);  
       for(i=0;i<=index;i++)  
       {  
           printf("%dth : %d\n",i,array[i]);     
       }  
       return 0;  
   }  

Compiler output:
main.c: In function 'main':
main.c:52:8: error: implicit declaration of function 'sort_insert_up'; did you mean 'sort_insert_down'? [-Wimplicit-function-declaration]
   52 |        sort_insert_up(array,index+1);
      |        ^~~~~~~~~~~~~~
      |        sort_insert_down
main.c: In function 'sort_insert_down':
main.c:58:4: error: expected declaration or statement at end of input
   58 |    }
      |    ^
Language: C

#include <stdio.h>

int i, j, k, n, A[100];

void pr(){
	for(j = 0; printf("%d", A[j]), j < n-1; j++) printf(" ");
	printf("\n");
}

int main(){
	scanf("%d", &n);
	while(i < n) scanf("%d", &A[i++]);
	for(i = 0; i < n; i++){
		for(j = i, k = A[i}; j > 0 && k < A[j-1]; j--) A[j] = A[j-1];
		A[j] = k;
		pr();
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:35: error: expected ']' before '}' token
   14 |                 for(j = i, k = A[i}; j > 0 && k < A[j-1]; j--) A[j] = A[j-1];
      |                                   ^
      |                                   ]
main.c:14:35: error: expected ';' before '}' token
   14 |                 for(j = i, k = A[i}; j > 0 && k < A[j-1]; j--) A[j] = A[j-1];
      |                                   ^
      |                                   ;
main.c:14:35: error: expected expression before '}' token
main.c:14:35: error: expected expression before '}' token
main.c:14:35: error: expected expression before '}' token
main.c:14:62: error: expected ';' before ')' token
   14 |                 for(j = i, k = A[i}; j > 0 && k < A[j-1]; j--) A[j] = A[j-1];
      |                                                              ^
      |                                                              ;
main.c:14:62: error: expected statement before ')' token
main.c: At top level:
main.c:18:9: error: expected identifier or '(' before 'return'
   18 |         return 0;
      |         ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

#include<stdio.h>

static const int N = 1000;

void trace(int A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

int main(){
  int n, i, j;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);

  trace(A, n);
  /*

    your code

   */
   for (int i = 2; i < N+1 ; i++) {
     int key = A[i];
     int j = i-1;
     while (j >= 1 && A[j] > key) {
       A[j+1] = A[j];
       /* code */
     }
     A[j+1] = key
     /* code */
   }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:18: error: expected ';' before '}' token
   34 |      A[j+1] = key
      |                  ^
      |                  ;
   35 |      /* code */
   36 |    }
      |    ~
Language: C

#include <stdio.h>

void trace(int *arr,int n){
  int i;
  for(i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%d",*(arr+i));
  }
  printf("\n");
}

void insertSort(int *arr,int n){
  int i,j;
  for(i=1;i<n;i++){
    int v=*(arr+i);
    j=i-1;
    while(j>=0&&a[j]>v){
      *(arr+j+1)=*(arr+j);
      j--;
    }
    *(arr+j+1)=v;
  }
}

int main(void){
  int n,i,j;
  scanf("%d",&n);
  int a[n];
  for(i=0;i<n;i++){
   scanf("%d",&a[i]);
  }

  trace(a,n);
  insertSort(a,n);
  return 0;
}

Compiler output:
main.c: In function 'insertSort':
main.c:17:17: error: 'a' undeclared (first use in this function)
   17 |     while(j>=0&&a[j]>v){
      |                 ^
main.c:17:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void)
{
 int N;
 int A[];
 int i, j;
 int v;

 scanf("%d", &N);
 
 for (i = 1, i < N, i++){
  scanf("%d", &A[i]);
  printf("%d ", A[i]);
  }
  scanf("%d", &A[N]);
  printf("%d\n", A[N]);

 for (i = 1, i < N, i++){
  v = A[i];
  j = i -1;
  while (j >= 0 && A[j] > v){
   A[j+1] = A[j]
   j = j--
   }
  A[j+1] = v;
 
  for (i = 1, i < N, i++){
   printf("%d ", A[i]);
   }
  printf("%d\n", A[N]);
  }

 return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:6:6: error: array size missing in 'A'
    6 |  int A[];
      |      ^
main.c:12:24: error: expected ';' before ')' token
   12 |  for (i = 1, i < N, i++){
      |                        ^
      |                        ;
main.c:12:24: error: expected expression before ')' token
main.c:19:24: error: expected ';' before ')' token
   19 |  for (i = 1, i < N, i++){
      |                        ^
      |                        ;
main.c:19:24: error: expected expression before ')' token
main.c:23:17: error: expected ';' before 'j'
   23 |    A[j+1] = A[j]
      |                 ^
      |                 ;
   24 |    j = j--
      |    ~             
main.c:28:25: error: expected ';' before ')' token
   28 |   for (i = 1, i < N, i++){
      |                         ^
      |                         ;
main.c:28:25: error: expected expression before ')' token
Language: C

#include <stdio.h>

int main(void)
{
 int N;
 int A[];
 int i, j;
 int v;

 scanf("%d", &N);
 
 for (i = 1, i < N, i++){
  scanf("%d", &A[i]);
  printf("%d ", A[i]);
  }
  scanf("%d", &A[N]);
  printf("%d\n", A[N]);

 for (i = 1, i < N, i++){
  v = A[i];
  j = i -1;
  while (j >= 0 && A[j] > v){
   A[j+1] = A[j];
   j = j--;
   }
  A[j+1] = v;
 
  for (i = 1, i < N, i++){
   printf("%d ", A[i]);
   }
  printf("%d\n", A[N]);
  }

 return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:6:6: error: array size missing in 'A'
    6 |  int A[];
      |      ^
main.c:12:24: error: expected ';' before ')' token
   12 |  for (i = 1, i < N, i++){
      |                        ^
      |                        ;
main.c:12:24: error: expected expression before ')' token
main.c:19:24: error: expected ';' before ')' token
   19 |  for (i = 1, i < N, i++){
      |                        ^
      |                        ;
main.c:19:24: error: expected expression before ')' token
main.c:28:25: error: expected ';' before ')' token
   28 |   for (i = 1, i < N, i++){
      |                         ^
      |                         ;
main.c:28:25: error: expected expression before ')' token
Language: C

#include <stdio.h>

int main(void)
{
 int N;
 int A[N];
 int i, j;
 int v;

 scanf("%d", &N);
 
 for (i = 1, i < N, i++);
 {
  scanf("%d", &A[i]);
  printf("%d ", A[i]);
  }
  scanf("%d", &A[N]);
  printf("%d\n", A[N]);

 for (i = 1, i < N, i++);
 {
  v = A[i];
  j = i -1;
  while (j >= 0 && A[j] > v){
   A[j+1] = A[j];
   j = j--;
   }
  A[j+1] = v;
 
  for (i = 1, i < N, i++);
  {
   printf("%d ", A[i]);
   }
  printf("%d\n", A[N]);
  }

 return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:12:24: error: expected ';' before ')' token
   12 |  for (i = 1, i < N, i++);
      |                        ^
      |                        ;
main.c:12:24: error: expected expression before ')' token
main.c:20:24: error: expected ';' before ')' token
   20 |  for (i = 1, i < N, i++);
      |                        ^
      |                        ;
main.c:20:24: error: expected expression before ')' token
main.c:30:25: error: expected ';' before ')' token
   30 |   for (i = 1, i < N, i++);
      |                         ^
      |                         ;
main.c:30:25: error: expected expression before ')' token