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

#include <stdio.h>
#define N 100
#define A 1000
int main(){
    int i,j,k,number;
    int a[A];
    int key;
    scanf("%d",&number);
    for(i=0;i<number;i++){
        scanf("%d",&a[i]);
    }
    for(j=1,j<=number-1;j++){
        key = a[j];
        i = j-1;
        while(i>0 && a[i] > key){
            a[i+1] = a[i];
            i = i-1;
        }
        a[i+1] = key;
        for(k=0;k<=number-1;k++){
        printf("%d  ",&a[i]);
        }
        printf(\n);
    }
}


Compiler output:
main.c: In function 'main':
main.c:12:28: error: expected ';' before ')' token
   12 |     for(j=1,j<=number-1;j++){
      |                            ^
      |                            ;
main.c:23:16: error: stray '\' in program
   23 |         printf(\n);
      |                ^
main.c:23:17: error: 'n' undeclared (first use in this function)
   23 |         printf(\n);
      |                 ^
main.c:23:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void){
    int A[6]={5,2,4,6,1,3};
    int i,j;
    int key;
    
    for(j = 0 ; j < sizeof(A) ; j ++){
        key = A[j];
        printf("%d",key);
        i = j-1;
    }
        while(i>0 && A[i]>key){
            A[i+1] = A[i];
            i = i-1;
            A[i+1] = key;
            printf("%d",key);
            printf("\n");
        }
    }
}


Compiler output:
main.c:21:1: error: expected identifier or '(' before '}' token
   21 | }
      | ^
Language: C

#include <stdio.h>
#define N 100
#define A 1000
int main(){
    int i,j,k,number;
    int a[A];
    int key;
    scanf("%d",&number);
    for(i=0;i<number;i++){
        scanf("%d",&a[i]);
    }
    for(j=1;j<=number-1;j++){
        key = a[j];
        i = j-1;
        while(i>0 && a[i] > key){
            a[i+1] = a[i];
            i = i-1;
        }
        a[i+1] = key;
        for(k=0;k<=number-1;k++){
        printf("%d  ",&a[i]);
        }
        printf(\n);
    }
}


Compiler output:
main.c: In function 'main':
main.c:23:16: error: stray '\' in program
   23 |         printf(\n);
      |                ^
main.c:23:17: error: 'n' undeclared (first use in this function)
   23 |         printf(\n);
      |                 ^
main.c:23:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(){
    
    int i,j,v,N,n;
    int A[1000];
    
    scanf("%d",&N);
    
    for(i=0;i<N;i++){
        scanf("%d",&A[i])
    }
    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(n=0;n<N;n++){
        printf("%d ",A[n]);
    }
printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:10:26: error: expected ';' before '}' token
   10 |         scanf("%d",&A[i])
      |                          ^
      |                          ;
   11 |     }
      |     ~
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:16:28: error: expected ';' before 'j'
   16 |             In[j+1] = In[j]
      |                            ^
      |                            ;
   17 |             j--
      |             ~
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:15:28: error: expected ';' before 'j'
   15 |             In[j+1] = In[j]
      |                            ^
      |                            ;
   16 |             j--
      |             ~
Language: C

#include<stdio.h>

main(){
  int i,n,v,j,k;
    
    scanf("%d",&n);
    
    int A[n];
    
    for(i=0;i<n;i++)
      {
	scanf("%d",&A[i]);
      }
    
    
    for(i=1;i<n;i++)
      {
	for(k=0;k<n;k++)
	  {
	    printf("%d",A[k]);
	    if(k+1!=n){
	        printf(" ");
	    }
	  }
	printf("\n");
	
        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]);
        if(i+1!=n){
            printf(" ");
        }
        printf("\n")
	}

}



Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:43:21: error: expected ';' before '}' token
   43 |         printf("\n")
      |                     ^
      |                     ;
   44 |         }
      |         ~
Language: C

#include <stdio.h>
#define N 10000

int A[N],i,j,v;

for(i=0;i<N;i++){
    
    scanf(%d,A[i]);
    if(A[i] != 0){
      break;      
    }
    
    v = A[i];
    
    for(j=0;j<i;j++){
        
        
        
    }
    
     
}


Compiler output:
main.c:6:1: error: expected identifier or '(' before 'for'
    6 | for(i=0;i<N;i++){
      | ^~~
main.c:6:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 | for(i=0;i<N;i++){
      |          ^
main.c:6:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    6 | for(i=0;i<N;i++){
      |              ^~
Language: C

#include <stdio.h>
int main(void) {
  int A[100];
  int i,j,N,k,v;

  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; k < N-1k    ++) {
      printf("%d　",A[k]);
    }
    printf("\n");
  }
}



Compiler output:
main.c: In function 'main':
main.c:20:23: error: fixed-point types not supported for this target
   20 |     for (k = 0; k < N-1k    ++) {
      |                       ^~
main.c:20:31: error: expected ';' before ')' token
   20 |     for (k = 0; k < N-1k    ++) {
      |                               ^
      |                               ;
Language: C

#include<stdio.h>

int main(){

  int A[1000];
  int N = 0;
  int i,j,v,length;

  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 = j - 1;

    }

    A[j + 1] = key;

    for(length = 0; length < N-1; length++){
      printf("%d ",A[length]);
    }
    printf("%d\n",A[N-1]);
  }
  printf("%d\n",A[100]);
  return 0;

}



Compiler output:
main.c: In function 'main':
main.c:31:16: error: 'key' undeclared (first use in this function)
   31 |     A[j + 1] = key;
      |                ^~~
main.c:31:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdo.h>

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



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

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:11:27: error: expected ']' before ')' token
   11 |         while(j>=0 && In[j)>V){
      |                           ^
      |                           ]
main.c:11:28: error: expected expression before '>' token
   11 |         while(j>=0 && In[j)>V){
      |                            ^
main.c:11:30: error: expected statement before ')' token
   11 |         while(j>=0 && In[j)>V){
      |                              ^
main.c:17:31: error: expected ')' before ';' token
   17 |             printf("%d ",In[k];)
      |                   ~           ^
      |                               )
main.c:17:33: error: expected ';' before '}' token
   17 |             printf("%d ",In[k];)
      |                                 ^
      |                                 ;
   18 |         }
      |         ~
Language: C

#include<stdio.h>
int InsertionSort(int,int)
int main(){

  int A[1000];
  int N = 0;
  int i,j,v,length;

  scanf("%d",&N);

  for(i = 0; i < N; i++){

    scanf("%d",&A[i]);

  }

 
    for(length = 0; length < N-1; length++){
      printf("%d ",A[length]);
    }
    printf("%d\n",A[N-1]);
  }
  printf("%d\n",A[100]);
  return 0;

}

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



Compiler output:
main.c: In function 'InsertionSort':
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main(){
      |           ^
main.c:23:3: error: expected declaration specifiers before 'printf'
   23 |   printf("%d\n",A[100]);
      |   ^~~~~~
main.c:24:3: error: expected declaration specifiers before 'return'
   24 |   return 0;
      |   ^~~~~~
main.c:26:1: error: expected declaration specifiers before '}' token
   26 | }
      | ^
main.c:28:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   28 | int InsertionSort(a,n){
      |                       ^
main.c:39: error: expected '{' at end of input
Language: C

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:14:27: error: expected ']' before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                           ^
      |                           ]
main.c:14:28: error: expected expression before '>' token
   14 |         while(j>=0 && In[j)>V){
      |                            ^
main.c:14:30: error: expected statement before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                              ^
main.c:20:31: error: expected ')' before ';' token
   20 |             printf("%d ",In[k];)
      |                   ~           ^
      |                               )
main.c:20:33: error: expected ';' before '}' token
   20 |             printf("%d ",In[k];)
      |                                 ^
      |                                 ;
   21 |         }
      |         ~
Language: C

#include <stdio.h>
int main(){

  int N ,v,i,j;
  int A[1000];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(j=0;j<N;j++){
      printf("%d ",A[j]);
    }
    printf("\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;
    for(j=0;j<N;j++){
     
      printf("%d ",A[j]);
    }
    printf("\n");
   
  }

  
  return 0;
}
std3dc29:~ s1250105[82]$ cat test.c
#include <stdio.h>
int main(){

  int N ,v,i,j;
  int A[1000];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(j=0;j<N;j++){
      printf("%d ",A[j]);
    }
    printf("\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;
    for(j=0;j<N;j++){
     
      if (j<N-1) printf("%d ",A[j]);
    }
    printf("\n");
   
  }

  
  return 0;
}



Compiler output:
main.c:37:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   37 | std3dc29:~ s1250105[82]$ cat test.c
      |         ^
Language: C

#include"stdio.h"
int main()
{
  int num;
  int A[1000];
  int i,j,k;
  int v;
  scanf("%d",&num);
  if(num<0&&1000<num)continue;
  for(k=0;k<num;k++)
    {
      scanf("%d",&A[k]);
    }
  for(k=0;k<num;k++)
    {
      printf("%d ",A[k]);
    }
  printf("\n");
  for(i=1;i<num;i++)
    {
      if(A[i-1]>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[0]);
      for(k=1;k<num;k++)
	{
	  printf(" %d",A[k]);
	}
      if(i<num-1)
	{
	  printf("\n");
	}
    }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:22: error: continue statement not within a loop
    9 |   if(num<0&&1000<num)continue;
      |                      ^~~~~~~~
Language: C

#include<stdio.h>
int main(){
int i = 0;
int j = 0;
int k = 0;
int N;

scanf("%d",&N);
int A[1000],v;


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

// N個の要素を含む0-オリジンの配列
    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;
}

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

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:13: error: expected ';' before '}' token
   30 | printf("\n")
      |             ^
      |             ;
   31 |     }
      |     ~
Language: C

#include <stdio.h>
  
int main(void)
{
 
  int i, j, v;
 

  int A[100];
 
 
  int total;

  scanf("%d", &total);
 

 
  for (i=0; i<total; ++i)
    scanf("%d", &A[i]);
 
  
  for (i=0; i<total; ++i) {
    for (j=i+1; j<total; ++j) {
      if (A[i] > A[j]) {
        v =  A[i];
        A[i] = A[j];
        A[j] = v;
      }
    }
  }

  for (i=0; i<total; ++i)
    printf("%d\n", number[i]);
}


Compiler output:
main.c: In function 'main':
main.c:33:20: error: 'number' undeclared (first use in this function)
   33 |     printf("%d\n", number[i]);
      |                    ^~~~~~
main.c:33:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
int i = 0;
int j = 0;
int k = 0;
int N;

scanf("%d",&N);
int A[1000],v;

heap = (int *)malloc(sizeof(int) * N);
for(i=0;i<N;i++){
  scanf("%d",&A[i]);
}

// N個の要素を含む0-オリジンの配列
    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;
}

for(k= 0;k<N;k++){
  printf("%d",A[k]);
}

printf("\n");
    }

return 0;
}



Compiler output:
main.c: In function 'main':
main.c:11:1: error: 'heap' undeclared (first use in this function)
   11 | heap = (int *)malloc(sizeof(int) * N);
      | ^~~~
main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   11 | heap = (int *)malloc(sizeof(int) * N);
      |               ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main(){
main.c:11:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   11 | heap = (int *)malloc(sizeof(int) * N);
      |               ^~~~~~
main.c:11:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
Language: C

#include<stdio.h>
int main(){
int i = 0;
int j = 0;
int k = 0;
int N;

scanf("%d",&N);
int A[1000],v;

A = (int *)malloc(sizeof(int) * N);
for(i=0;i<N;i++){
  scanf("%d",&A[i]);
}

// N個の要素を含む0-オリジンの配列
    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;
}

for(k= 0;k<N;k++){
  printf("%d",A[k]);
}

printf("\n");
    }

return 0;
}



Compiler output:
main.c: In function 'main':
main.c:11:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   11 | A = (int *)malloc(sizeof(int) * N);
      |            ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main(){
main.c:11:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   11 | A = (int *)malloc(sizeof(int) * N);
      |            ^~~~~~
main.c:11:12: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:11:3: error: assignment to expression with array type
   11 | A = (int *)malloc(sizeof(int) * N);
      |   ^
Language: C

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:14:27: error: expected ']' before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                           ^
      |                           ]
main.c:14:28: error: expected expression before '>' token
   14 |         while(j>=0 && In[j)>V){
      |                            ^
main.c:14:30: error: expected statement before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                              ^
main.c:20:32: error: expected ';' before '}' token
   20 |             printf("%d ",In[k])
      |                                ^
      |                                ;
   21 |         }
      |         ~
Language: C

#include<stdio.h>
int main(){
int i = 0;
int j = 0;
int k = 0;
int N;

scanf("%d",&N);
int A[1000],v;

A = (int *)malloc(sizeof(int) * N);
for(i=0;i<N;i++){
  scanf("%d",&A[i]);
}

// N個の要素を含む0-オリジンの配列
    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;
}

for(k= 0;k<N;k++){
  printf("%d ",A[k]);
}

printf("\n");
    }

return 0;
}



Compiler output:
main.c: In function 'main':
main.c:11:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   11 | A = (int *)malloc(sizeof(int) * N);
      |            ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main(){
main.c:11:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   11 | A = (int *)malloc(sizeof(int) * N);
      |            ^~~~~~
main.c:11:12: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:11:3: error: assignment to expression with array type
   11 | A = (int *)malloc(sizeof(int) * N);
      |   ^
Language: C

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:14:27: error: expected ']' before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                           ^
      |                           ]
main.c:14:28: error: expected expression before '>' token
   14 |         while(j>=0 && In[j)>V){
      |                            ^
main.c:14:30: error: expected statement before ')' token
   14 |         while(j>=0 && In[j)>V){
      |                              ^
Language: C

#include<stdio.h>

int main(){
    int a,b;
    int i=0,j,k;
    int s[100];
    scanf("%d",&a);
    s = (int *)malloc(a * sizeof(int));
    while(i<a){
    scanf("%d",&s[i]);
    i++;
}
    for(i=1;i<a;i++){
        b=s[i];
        j=i-1;
        while(j>= 0||s[j] > b){
        s[j+1]=s[j];
        j--;
        s[j+1]=b;
        }
        for(k=0;k<a;k++){
        printf("%d ",s[k]);
        }
        printf("\n");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:16: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |     s = (int *)malloc(a * sizeof(int));
      |                ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:16: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |     s = (int *)malloc(a * sizeof(int));
      |                ^~~~~~
main.c:8:16: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:8:7: error: assignment to expression with array type
    8 |     s = (int *)malloc(a * sizeof(int));
      |       ^
Language: C

#include"stdio.h"
int main()
{
  int num;
  int A[1000];
  int i,j,k;
  int v;
  scanf("%d",&num);
  if(num<0&&1000<num)continue;
  for(k=0;k<num;k++)
    {
      scanf("%d",&A[k]);
      if(A[k]<0&&100<A[k])k--;
    }
  for(k=0;k<num;k++)
    {
      printf("%d ",A[k]);
    }
  printf("\n");
  for(i=1;i<num;i++)
    {
      if(A[i-1]>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[0]);
      for(k=1;k<num;k++)
	{
	  printf(" %d",A[k]);
	}
      if(i<num-1)
	{
	  printf("\n");
	}
    }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:22: error: continue statement not within a loop
    9 |   if(num<0&&1000<num)continue;
      |                      ^~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(){
    int elementNumber, *numberArray;
    // read input
    scanf("%d\n",&elementNumber);
    numberArray = ( int* )malloc( elementNumber*sizeof( int ));
    for ( int ixArray = 0 ; ixArray < elementNumber ; ixArray++ ){
        scanf("%d",&numberArray[ixArray]);
        printf("%d ",numberArray[ixArray]); // print result of initial step
    }
    // sort in ascending order
    for (int jxArray = 1 ; jxArray < elementNumber ; jxArray++ ){        
        int keyNumber = numberArray[jxArray];
        int ixArray = jxArray-1;
        while ( ixArray >= 0 && numberArray[ixArray] > keyNumber ){
            numberArray[ixArray+1] = numberArray[ixArray];
            ixArray = ixArray-1;
        }
        numberArray[ixArray+1] = keyNumber;
        //print result after each step
        for ( int kxArray = 0 ; kxArray < elementNumber ; kxArray++ )
            printf("\n");
            printf("%d",numberArray[kxArray]);
            
    }
    free(numberArray);
    return EXIT_SUCCESS;
}



Compiler output:
main.c: In function 'main':
main.c:25:37: error: 'kxArray' undeclared (first use in this function); did you mean 'ixArray'?
   25 |             printf("%d",numberArray[kxArray]);
      |                                     ^~~~~~~
      |                                     ixArray
main.c:25:37: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
    int a,b;
    int i=0,j,k;
    int s*;
    scanf("%d",&a);
    s = (int *)malloc(a * sizeof(int));
    while(i<a){
    scanf("%d",&s[i]);
    i++;
}
    for(i=1;i<a;i++){
        b=s[i];
        j=i-1;
        while(j>= 0||s[j] > b){
        s[j+1]=s[j];
        j--;
        s[j+1]=b;
        }
        for(k=0;k<a;k++){
        printf("%d ",s[k]);
        }
        printf("\n");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
    6 |     int s*;
      |          ^
main.c:6:11: error: expected expression before ';' token
    6 |     int s*;
      |           ^
main.c:8:5: error: 's' undeclared (first use in this function)
    8 |     s = (int *)malloc(a * sizeof(int));
      |     ^
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:16: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |     s = (int *)malloc(a * sizeof(int));
      |                ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:16: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |     s = (int *)malloc(a * sizeof(int));
      |                ^~~~~~
main.c:8:16: note: include '<stdlib.h>' or provide a declaration of 'malloc'
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,j,k,key,hzi;
  int *hai;
  scanf("%d",&i);
  hai=(int *)malloc(sizeof(int));
  for(j=0;j<i;j++){
    scanf("%ld",&hai[j]);
  }
  for(j=1;j<i;j++){
    key=hai[j];
    hzi=j-1;
    while(hzi>=0 && hai[hzi]>key){
      hai[hzi+1]=hai[hzi];
      hzi--;
    }
    hai[hzi+1]=key;
    for(k=0;k<i;k++){
     printf("%d",hai[k]);
     if(k!=i-1){
       printf(" ");
     }
    }
   printf("\n");
  }
free(hai);
return 0;
}
std3dc12:algorithms s1250102[105]$ gcc pr1-1.c 
std3dc12:algorithms s1250102[106]$ cat pr1-1.c 
#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,j,k,key,hzi;
  int *hai;
  scanf("%d",&i);
  hai=(int *)malloc(sizeof(int));
  for(j=0;j<i;j++){
    scanf("%ld",&hai[j]);
  }
  for(j=1;j<i;j++){
    key=hai[j];
    hzi=j-1;
    while(hzi>=0 && hai[hzi]>key){
      hai[hzi+1]=hai[hzi];
      hzi--;
    }
    hai[hzi+1]=key;
    for(k=0;k<i;k++){
     printf("%d",hai[k]);
     if(k!=i-1){
       printf("  ");
     }
    }
   printf("\n");
  }
free(hai);
return 0;
}



Compiler output:
main.c:30:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   30 | std3dc12:algorithms s1250102[105]$ gcc pr1-1.c
      |         ^
main.c:30:44: error: invalid suffix "c" on floating constant
   30 | std3dc12:algorithms s1250102[105]$ gcc pr1-1.c
      |                                            ^~~
main.c:31:44: error: invalid suffix "c" on floating constant
   31 | std3dc12:algorithms s1250102[106]$ cat pr1-1.c
      |                                            ^~~
Language: C

#include<stdio.h>

int main(void){
  int i,j,s;
  int Sort[100];
  int number;
  scanf("%d",&number);
  for(i=0,i<number;i++)
    scanf("%d",&Sort[i]);
  for(i=0;i<number;i++){
    for(j=0;j<number;j++){
      while(i >= 0 && j >= 0)
      if(Sort[i] > Sort[j]){
	s = Sort[i];
	Sort[i] = Sort[j];
	Sort[j] = s;
	for(s=0;s<number;s++)
	  printf("%d\n",Sort[s]);
	  i--;
	  j--;
      }
    }
  }
}



Compiler output:
main.c: In function 'main':
main.c:8:23: error: expected ';' before ')' token
    8 |   for(i=0,i<number;i++)
      |                       ^
      |                       ;
Language: C

  int i,j,v,N,n;
    int A[1000];

    scanf("%d",&N);

    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
    }
    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(n=0;n<N;n++){
        printf("%d ",A[n]);

    }
printf("\n");
    }
}




Compiler output:
main.c:4:11: error: expected declaration specifiers or '...' before string constant
    4 |     scanf("%d",&N);
      |           ^~~~
main.c:4:16: error: expected declaration specifiers or '...' before '&' token
    4 |     scanf("%d",&N);
      |                ^
main.c:6:5: error: expected identifier or '(' before 'for'
    6 |     for(i=0;i<N;i++){
      |     ^~~
main.c:6:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 |     for(i=0;i<N;i++){
      |              ^
main.c:6:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    6 |     for(i=0;i<N;i++){
      |                  ^~
main.c:9:5: error: expected identifier or '(' before 'for'
    9 |     for(i=1;i<=N-1;i++){
      |     ^~~
main.c:9:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    9 |     for(i=1;i<=N-1;i++){
      |              ^~
main.c:9:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    9 |     for(i=1;i<=N-1;i++){
      |                     ^~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include<stdio.h>

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

    printf("\n");
  }
      for(k=0;k<n;k++){
      printf("%d",A[k]);
    }
    printf("\n")
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:25:17: error: expected ';' before 'return'
   25 |     printf("\n")
      |                 ^
      |                 ;
   26 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>

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

    printf("\n");
  }
      for(k=0;k<n;k++){
      printf("%d ",A[k]);
    }
    printf("\n")
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:25:17: error: expected ';' before 'return'
   25 |     printf("\n")
      |                 ^
      |                 ;
   26 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>

int main() {
    
  int i,j,v,m,a,N,p;
  int A[1000];

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

  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(p=0;p<N;p++) {
      printf("%d",A[p]);
      if(p<N-1)printf(" ");
    
    printf("\n");
}
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

#include<stdio.h>

int main(){
    int i = 0;
    int data = 0;
    int V = 0;
    int j = 0;
    int insert[data];
    
    scanf("%d",&data);
    for(i = 0 ; i++ ; i < data){
    scanf("%d",&insert[i]);
    }
    for(i = 0 ; i++ ; i < data){
        V = insert[i];
        j = i - 1;
        
        while(j >= 0 && insert[j] > V){
            insert[j + 1] = insert[j];
            j--;
            insert[j + 1] = V;
        }
    }
    for(i = 0 ; i++ ; i < data){
        printf("%d",insert[i]);
    }
    printf("\n");
    insert = (int*)malloc(sizeof(insert[]));
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:20: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   28 |     insert = (int*)malloc(sizeof(insert[]));
      |                    ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:28:20: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   28 |     insert = (int*)malloc(sizeof(insert[]));
      |                    ^~~~~~
main.c:28:20: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:28:41: error: expected expression before ']' token
   28 |     insert = (int*)malloc(sizeof(insert[]));
      |                                         ^
Language: C

#include<stdio.h>



void trace(int A[],int N);
void insertsort(int A[],int N);




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;
}





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 insertsort(int A[],int N){
  int j,i,v;
  int k;
  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);
  }
}



Compiler output:
main.c: In function 'trace':
main.c:36:19: warning: missing terminating " character
   36 |     if(i>0)printf("  );
      |                   ^
main.c:36:19: error: missing terminating " character
   36 |     if(i>0)printf("  );
      |                   ^~~~~
main.c:37:22: error: expected ')' before ';' token
   37 |     printf("%d",A[i]);
      |                      ^
      |                      )
main.c:36:18: note: to match this '('
   36 |     if(i>0)printf("  );
      |                  ^
main.c:37:5: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   37 |     printf("%d",A[i]);
      |     ^~~~~~~~~~~~~~~~~
      |     |
      |     int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:37:23: error: expected ';' before '}' token
   37 |     printf("%d",A[i]);
      |                       ^
      |                       ;
   38 |   }
      |   ~
Language: C

#include<stdio.h>

int main(){
    int i = 0;
    int data = 0;
    int V = 0;
    int j = 0;
    int insert[data];
    
    scanf("%d",&data);
    insert = (int*)malloc(sizeof(int));
    for(i = 0 ; i++ ; i < data){
    scanf("%d",&insert[i]);
    }
    for(i = 0 ; i++ ; i < data){
        V = insert[i];
        j = i - 1;
        
        while(j >= 0 && insert[j] > V){
            insert[j + 1] = insert[j];
            j--;
            insert[j + 1] = V;
        }
    }
    for(i = 0 ; i++ ; i < data){
        printf("%d",insert[i]);
    }
    printf("\n");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:20: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   11 |     insert = (int*)malloc(sizeof(int));
      |                    ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:11:20: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   11 |     insert = (int*)malloc(sizeof(int));
      |                    ^~~~~~
main.c:11:20: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:11:12: error: assignment to expression with array type
   11 |     insert = (int*)malloc(sizeof(int));
      |            ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define A 1000
int main(){
    int i,j,k,number;
    int *a;
    int key;
    scanf("%d",&number);
    a = (int *)malloc((sizeof(int)*n);
    for(i=0;i<number;i++){
        scanf("%d",a[i]);
    }
    for(j=1;j<=number-1;j++){
        key = a[j];
        i = j-1;
        while(i>0 && a[i] < key){
            a[i+1] = a[i];
            i = i-1;
        }
        a[i+1] = key;
        for(k=0;k<=number-1;k++){
        printf("%d  ",&a[k]);
        }
        printf("\n");
    }
    free(a);
}


Compiler output:
main.c: In function 'main':
main.c:10:36: error: 'n' undeclared (first use in this function)
   10 |     a = (int *)malloc((sizeof(int)*n);
      |                                    ^
main.c:10:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:38: error: expected ')' before ';' token
   10 |     a = (int *)malloc((sizeof(int)*n);
      |                      ~               ^
      |                                      )
main.c:27:13: error: expected ';' before '}' token
   27 |     free(a);
      |             ^
      |             ;
   28 | }
      | ~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define A 1000
int main(){
    int i,j,k,number;
    int *a;
    int key;
    scanf("%d",&number);
    a = (int *)malloc(sizeof(int)*n);
    for(i=0;i<number;i++){
        scanf("%d",a[i]);
    }
    for(j=1;j<=number-1;j++){
        key = a[j];
        i = j-1;
        while(i>0 && a[i] < key){
            a[i+1] = a[i];
            i = i-1;
        }
        a[i+1] = key;
        for(k=0;k<=number-1;k++){
        printf("%d  ",&a[k]);
        }
        printf("\n");
    }
    free(a);
}


Compiler output:
main.c: In function 'main':
main.c:10:35: error: 'n' undeclared (first use in this function)
   10 |     a = (int *)malloc(sizeof(int)*n);
      |                                   ^
main.c:10:35: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
    int i = 0;
    int data = 0;
    int V = 0;
    int j = 0;
    int *insert;
    
    scanf("%d",&data);
    insert = (int*)malloc(sizeof(int));
    for(i = 0 ; i++ ; i < data){
    scanf("%d",&insert[i]);
    }
    printf("%d",insert[0]);
    for(i = 0 ; k < data ; i++){
        printf(" %d ",insert[i]);
    }
    printf("\n");
    for(i = 0 ; i++ ; i < data){
        V = insert[i];
        j = i - 1;
        
        while(j >= 0 && insert[j] > V){
            insert[j + 1] = insert[j];
            j--;
            insert[j + 1] = V;
        }
    }
    for(i = 0 ; i++ ; i < data){
        printf("%d",insert[i]);
    }
    printf("\n");
    free(insert);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:17: error: 'k' undeclared (first use in this function)
   17 |     for(i = 0 ; k < data ; i++){
      |                 ^
main.c:17:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
    int i = 0;
    int data = 0;
    int V = 0;
    int j = 0;
    int *insert;
    
    scanf("%d",&data);
    insert = (int*)malloc(sizeof(int));
    for(i = 0 ; i++ ; i < data){
    scanf("%d",&insert[i]);
    }
    printf("%d",insert[0]);
    for(i = 0 ; k < data ; i++){
        printf(" %d ",insert[i]);
    }
    printf("\n");
    for(i = 0 ; i++ ; i < data){
        V = insert[i];
        j = i - 1;
        
        while(j >= 0 && insert[j] > V){
            insert[j + 1] = insert[j];
            j--;
            insert[j + 1] = V;
        }
        printf("%d",insert[0]);
    for(i = 0 ; k < data ; i++){
        printf(" %d ",insert[i]);
    }
    printf("\n");
    }
    for(i = 0 ; i++ ; i < data){
        printf("%d",insert[i]);
    }
    printf("\n");
    free(insert);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:17: error: 'k' undeclared (first use in this function)
   17 |     for(i = 0 ; k < data ; i++){
      |                 ^
main.c:17:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
    int i = 0;
    int data = 0;
    int V = 0;
    int j = 0;
    int *insert;
    
    scanf("%d",&data);
    insert = (int*)malloc(sizeof(int));
    for(i = 0 ; i++ ; i < data){
    scanf("%d",&insert[i]);
    }
    printf("%d",insert[0]);
    for(i = 0 ; k < data ; i++){
        printf(" %d ",insert[i]);
    }
    printf("\n");
    for(i = 0 ; i++ ; i < data){
        V = insert[i];
        j = i - 1;
        
        while(j >= 0 && insert[j] > V){
            insert[j + 1] = insert[j];
            j--;
            insert[j + 1] = V;
        }
        printf("%d",insert[0]);
    for(i = 0 ; k < data ; i++){
        printf(" %d ",insert[i]);
    }
    printf("\n");
    }
   
    free(insert);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:17: error: 'k' undeclared (first use in this function)
   17 |     for(i = 0 ; k < data ; i++){
      |                 ^
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(){
  int n;
  scanf("%d",&n);

  int A[n],v;
  int i,j;

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

  for(i=1;i<x;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<x;j++){
      printf("%d",A[j]);
      if(j<x-1) printf(" ");
      else printf("\n");
    }
  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:13: error: 'x' undeclared (first use in this function)
   10 |   for(i=0;i<x;i++){
      |             ^
main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(int argc, char* argv[]){
	int count;
	int A[];
	int N = argc - 1;
	for(count = 0 ; count < argc ; count++){
		A[count] = (int)argv[count + 1];
	}
	insertionSort(A, N);
}

void insertionSort(int A, int 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(k = 1 ; k <= N - 1 ; k++){
            printf(A[k]);
        }
        printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:4:13: error: array size missing in 'A'
    4 |         int A[];
      |             ^
main.c:7:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    7 |                 A[count] = (int)argv[count + 1];
      |                            ^
main.c:9:9: error: implicit declaration of function 'insertionSort' [-Wimplicit-function-declaration]
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:12:6: warning: conflicting types for 'insertionSort'; have 'void(int,  int)'
   12 | void insertionSort(int A, int N){
      |      ^~~~~~~~~~~~~
main.c:9:9: note: previous implicit declaration of 'insertionSort' with type 'void(int,  int)'
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:13:9: error: 'i' undeclared (first use in this function)
   13 |     for(i = 1 ; i <= N - 1 ; i++){
      |         ^
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'v' undeclared (first use in this function)
   14 |         v = A[i];
      |         ^
main.c:15:9: error: 'j' undeclared (first use in this function)
   15 |         j = i - 1;
      |         ^
main.c:17:25: error: expected ';' before 'j'
   17 |             A[j+1] =A[j]
      |                         ^
      |                         ;
   18 |             j--;
      |             ~            
main.c:21:13: error: 'k' undeclared (first use in this function)
   21 |         for(k = 1 ; k <= N - 1 ; k++){
      |             ^
Language: C

#include<stdio.h>
int main(int argc, char* argv[]){
	int count;
	int A[];
	int N = argc - 1;
	for(count = 0 ; count < argc ; count++){
		A[count] = (int)argv[count + 1];
	}
	insertionSort(A, N);
}

void insertionSort(int A, int N){
    int i, j, k, 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(k = 1 ; k <= N - 1 ; k++){
            printf(A[k]);
        }
        printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:4:13: error: array size missing in 'A'
    4 |         int A[];
      |             ^
main.c:7:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    7 |                 A[count] = (int)argv[count + 1];
      |                            ^
main.c:9:9: error: implicit declaration of function 'insertionSort' [-Wimplicit-function-declaration]
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:12:6: warning: conflicting types for 'insertionSort'; have 'void(int,  int)'
   12 | void insertionSort(int A, int N){
      |      ^~~~~~~~~~~~~
main.c:9:9: note: previous implicit declaration of 'insertionSort' with type 'void(int,  int)'
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:15:14: error: subscripted value is neither array nor pointer nor vector
   15 |         v = A[i];
      |              ^
main.c:17:26: error: subscripted value is neither array nor pointer nor vector
   17 |         while(j >= 0 && A[j] > v){
      |                          ^
main.c:18:14: error: subscripted value is neither array nor pointer nor vector
   18 |             A[j+1] =A[j]
      |              ^
main.c:18:22: error: subscripted value is neither array nor pointer nor vector
   18 |             A[j+1] =A[j]
      |                      ^
main.c:18:25: error: expected ';' before 'j'
   18 |             A[j+1] =A[j]
      |                         ^
      |                         ;
   19 |             j--;
      |             ~            
main.c:21:10: error: subscripted value is neither array nor pointer nor vector
   21 |         A[j+1] = v;
      |          ^
main.c:23:21: error: subscripted value is neither array nor pointer nor vector
   23 |             printf(A[k]);
      |                     ^
Language: C

#include<stdio.h>
int main(int argc, char* argv[]){
	int count;
	int A[argc];
	int N = argc - 1;
	for(count = 0 ; count < argc ; count++){
		A[count] = (int)argv[count + 1];
	}
	insertionSort(A, N);
}

void insertionSort(int A[], int N){
    int i, j, k, 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(k = 1 ; k <= N - 1 ; k++){
            printf(A[k]);
        }
        printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:7:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    7 |                 A[count] = (int)argv[count + 1];
      |                            ^
main.c:9:9: error: implicit declaration of function 'insertionSort' [-Wimplicit-function-declaration]
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:12:6: warning: conflicting types for 'insertionSort'; have 'void(int *, int)'
   12 | void insertionSort(int A[], int N){
      |      ^~~~~~~~~~~~~
main.c:9:9: note: previous implicit declaration of 'insertionSort' with type 'void(int *, int)'
    9 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:18:25: error: expected ';' before 'j'
   18 |             A[j+1] =A[j]
      |                         ^
      |                         ;
   19 |             j--;
      |             ~            
main.c:23:21: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   23 |             printf(A[k]);
      |                    ~^~~
      |                     |
      |                     int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~