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

#include<stdio.h>
#define MAX 100

int N,A[MAX];

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

void sort(){
    int j,i,val;
    for(i=1;i<N;i++){
        val=A[i];
        j=i-1;
        while(j>=0&&A[j]>val){
            A[j+1]=A[j];
            j--;
        }
        A[j+1]=val;
        print();
        }
    }
    
int main(void){
    int i,j;
    
    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&A[i]);
    
    print();
    sort();
    
    return 0;
}    



Compiler output:
main.c: In function 'print':
main.c:12:5: error: implicit declaration of function 'prinft'; did you mean 'print'? [-Wimplicit-function-declaration]
   12 |     prinft("\n");
      |     ^~~~~~
      |     print
Language: C

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

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

void printArray(int N, int* A){
    int i;
    for(i = 0; i < N - 1; i++){
        printf("%d ", A[i]);
    }
    printf("%d", A[N - 1]);
}

void insertionSort(int N, int* A){
    int i, j, v;
    for(i = 1; i < N; i++){
        printArray(N, A);
        printf("\n");

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



int main(){
    int N;
    scanf("%d", &N);
    int* A;
    A = (int*)malloc(sizeof(A[0]) * N);
    scanArrayInt(N, A);
    insertionSort(N, A);
    printArray(N, A);
    printf("\n")
    return 0;
}


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

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

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

void printArray(int N, int* A){
    int i;
    for(i = 0; i < N - 1; i++){
        printf("%d ", A[i]);
    }
    printf("%d\n", A[N - 1]);
}

void insertionSort(int N, int* A){
    int i, j, v;
    for(i = 1; i < N; i++){
        printArray(N, A);

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



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<iostream>

using namespace std;

int main(void){
	int A[100];
	int N,t,j;
	cin>>N;
	for(int i=0;i<N;i++) cin>>A[i];
	
	for(int i=1;i<N;i++){
		for(int k=0;k<N;k++)cout<<A[k];
		cout<<endl;
		t=A[i];
		j=i-1;
		while(j>=0&&A[j]>t){
			A[j+1]=A[j];
			j--;
			A[j+1]=t;
		}
		
	}
	
	return 0;
}


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


#include<iostream>

using namespace std;

int main(void){
	int A[100];
	int N,t,j;
	cin>>N;
	for(int i=0;i<N;i++) cin>>A[i];
	
	for(int i=1;i<N;i++){
		for(int k=0;k<N;k++)cout<<A[k]<<" ";
		cout<<endl;
		t=A[i];
		j=i-1;
		while(j>=0&&A[j]>t){
			A[j+1]=A[j];
			j--;
			A[j+1]=t;
		}
		
	}
	
	return 0;
}


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

#include<iostream>

using namespace std;

int main(void){
	int A[100];
	int N,t,j;
	cin>>N;
	for(int i=0;i<N;i++) cin>>A[i];
	
	for(int i=1;i<N;i++){
		for(int k=0;k<N;k++)cout<<A[k]<<" ";
		cout<<endl;
		t=A[i];
		j=i-1;
		while(j>=0&&A[j]>t){
			A[j+1]=A[j];
			j--;
			A[j+1]=t;
		}
		
	}
	
	return 0;
}


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

#include <stdio.h>

void trace(int,int);
void insertionSort(int,int);

int main(void){
	int N, i;
	int A[100];
	scanf("%d",&N);
	for(i=0;i<N;i++) scanf("%d",&A[i]);
	
	trace(A,N);
	insertionSort(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 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);
	}
}


Compiler output:
main.c: In function 'main':
main.c:12:15: error: passing argument 1 of 'trace' makes integer from pointer without a cast [-Wint-conversion]
   12 |         trace(A,N);
      |               ^
      |               |
      |               int *
main.c:3:12: note: expected 'int' but argument is of type 'int *'
    3 | void trace(int,int);
      |            ^~~
main.c:13:23: error: passing argument 1 of 'insertionSort' makes integer from pointer without a cast [-Wint-conversion]
   13 |         insertionSort(A,N);
      |                       ^
      |                       |
      |                       int *
main.c:4:20: note: expected 'int' but argument is of type 'int *'
    4 | void insertionSort(int,int);
      |                    ^~~
main.c: At top level:
main.c:17:6: error: conflicting types for 'trace'; have 'void(int *, int)'
   17 | void trace(int A[],int N) {
      |      ^~~~~
main.c:3:6: note: previous declaration of 'trace' with type 'void(int,  int)'
    3 | void trace(int,int);
      |      ^~~~~
main.c:26:6: error: conflicting types for 'insertionSort'; have 'void(int *, int)'
   26 | void insertionSort(int A[], int N) {
      |      ^~~~~~~~~~~~~
main.c:4:6: note: previous declaration of 'insertionSort' with type 'void(int,  int)'
    4 | void insertionSort(int,int);
      |      ^~~~~~~~~~~~~
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");
}

/*挿入ソート　0オリジン配列*/
void insertionSort(int A[], int N) {
  int j, i, 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:5:1: error: stray '\343' in program
    5 | <U+3000>int i;
      | ^~~~~~~~
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");
}

/*挿入ソート　0オリジン配列*/
void insertionSort(int A[], int N) {
  int j, i, 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:5:1: error: stray '\343' in program
    5 | <U+3000>int i;
      | ^~~~~~~~
Language: C

#include<stdio.h>

/*配列の要素を順番に出力*/
void supertrace(int A[],int N){
    int i;
    for(i=0;i<N;i++){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}

/*挿入ソート（0オリジン配列）*/
void insertionSort(int A[],int N){
    int j,i,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;
        supertrace(A,N);
    }
}





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



Compiler output:
main.c: In function 'main':
main.c:43:5: error: expected declaration or statement at end of input
   43 |     return 0;
      |     ^~~~~~
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");
}

void sort(int *A, int i, int n) {
    int min;
    min=A[i];
    for (i; i<n; i++) {
        if (A[i]<min) {
             tmp=min;
             min=A[i];
             A[i]=tmp;
            break;
        }
    }
}

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);
  for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);

  return 0;
}


Compiler output:
main.c: In function 'sort':
main.c:19:14: error: 'tmp' undeclared (first use in this function)
   19 |              tmp=min;
      |              ^~~
main.c:19:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:34:11: error: expected expression before ']' token
   34 |   trace(A[], n);
      |           ^
main.c:35:32: error: 'I' undeclared (first use in this function)
   35 |   for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);
      |                                ^
main.c:35:47: error: expected expression before ']' token
   35 |   for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);
      |                                               ^
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");
}

void sort(int *A, int i, int n) {
    int min, tmp;
    min=A[i];
    for (i; i<n; i++) {
        if (A[i]<min) {
             tmp=min;
             min=A[i];
             A[i]=tmp;
            break;
        }
    }
}

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);
  for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:11: error: expected expression before ']' token
   34 |   trace(A[], n);
      |           ^
main.c:35:32: error: 'I' undeclared (first use in this function)
   35 |   for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);
      |                                ^
main.c:35:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:47: error: expected expression before ']' token
   35 |   for (i=1; i<=n; i++) sort(A, I, n), trace(A[], n);
      |                                               ^
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");
}

void sort(int *A, int i, int n) {
    int min, tmp;
    min=A[i];
    for (i; i<n; i++) {
        if (A[i]<min) {
             tmp=min;
             min=A[i];
             A[i]=tmp;
            break;
        }
    }
}

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);
  for (i=1; i<=n; i++) sort(A, i, n), trace(A[], n);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:11: error: expected expression before ']' token
   34 |   trace(A[], n);
      |           ^
main.c:35:47: error: expected expression before ']' token
   35 |   for (i=1; i<=n; i++) sort(A, i, n), trace(A[], n);
      |                                               ^
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");
}

void sort(int *A, int i, int n) {
    int min, tmp, j;
    j=i;
    min=A[i];
    for (i; i<n; i++) {
        if (A[i]<min) {
             A[j]=A[i];
             A[i]=min;
            break;
        }
    }
}

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);
  for (i=1; i<=n; i++) sort(A, i, n), trace(A[], n);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:11: error: expected expression before ']' token
   34 |   trace(A[], n);
      |           ^
main.c:35:47: error: expected expression before ']' token
   35 |   for (i=1; i<=n; i++) sort(A, i, n), trace(A[], 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 j,i,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:5:39: error: expected ';' before 'printf'
    5 |                 if( i > 0 )printf(" ")
      |                                       ^
      |                                       ;
    6 |                 printf("%d" , A[i]);
      |                 ~~~~~~                 
main.c: In function 'insertionSort':
main.c:14:25: error: expected ';' before 'j'
   14 |                 v = A[i]
      |                         ^
      |                         ;
   15 |                 j = i - 1;
      |                 ~
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 j,i,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 'insertionSort':
main.c:15:25: error: expected ';' before 'j'
   15 |                 v = A[i]
      |                         ^
      |                         ;
   16 |                 j = i - 1;
      |                 ~
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 j,i,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 'insertionSort':
main.c:14:25: error: expected ';' before 'j'
   14 |                 v = A[i]
      |                         ^
      |                         ;
   15 |                 j = i - 1;
      |                 ~
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 j,i,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 'insertionSort':
main.c:14:25: error: expected ';' before 'j'
   14 |                 v = A[i]
      |                         ^
      |                         ;
   15 |                 j = i - 1;
      |                 ~
Language: C

#include <iostream>
#include <vector>

using namespace std;

void insertionSort(vector<int> vec)
{
	for (int i = 1; i < vec.size(); ++i)
	{
		int v = vec[i];
		int j = i - 1;
		while (j >= 0 && vec[j] > v)
		{
			vec[j + 1] = vec[j];
			--j;
		}
		vec[j + 1] = v;
		for (int j = 0; j < vec.size() - 1; ++j)
		{
			cout << vec[j] << " ";
		}
		cout << vec[vec.size() - 1] << endl;
	}
}

void solve()
{
	int N;
	cin >> N;
	vector<int> vec(N);
	for (int i = 0; i < N; ++i)
	{
		cin >> vec[i];
	}
	for (int j = 0; j < vec.size() - 1; ++j)
	{
		cout << vec[j] << " ";
	}
	cout << vec[vec.size() - 1] << endl;
	insertionSort(vec);
}

int main()
{
	solve();
	return(0);
}



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

#include<stdio.h>
main(int argc, char *argv[])){
    int i,j,key,N;
    N = (int)argv[1];
    int a[N];
    for(i=0;i<N;i++){
        a[i]=(int)argv[N+1+i];
        }
    for(j=1;i<N;i++){
        key = a[j];
        i=j-1;
        while(i>0 && a[i]<key){
            a[i+1]=a[i];
            i=i-1;
        }
        for(i=0;i<N;i++){
             printf("%d",a[i]);
         }
        
        a[i+1]=key;
    }
    
    for(i=0;i<N;i++){
        printf("%d",a[i]);
        }
}




Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(int argc, char *argv[])){
      | ^~~~
main.c: In function 'main':
main.c:2:29: error: expected declaration specifiers before ')' token
    2 | main(int argc, char *argv[])){
      |                             ^
main.c:29: error: expected '{' at end of input
Language: C

A[6]={5,2,4,6,1,3}

for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:3:1: error: expected ',' or ';' before 'for'
    3 | for i=1 to A.length-1
      | ^~~
Language: C

A[6]={5,2,4,6,1,3}

for i = 1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:3:1: error: expected ',' or ';' before 'for'
    3 | for i = 1 to A.length-1
      | ^~~
Language: C

A[6]={5,2,4,6,1,3};

for i = 1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:3:1: error: expected identifier or '(' before 'for'
    3 | for i = 1 to A.length-1
      | ^~~
Language: C

A[6]=(5,2,4,6,1,3)

for i = 1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]=(5,2,4,6,1,3)
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:1:6: error: invalid initializer
    1 | A[6]=(5,2,4,6,1,3)
      |      ^
main.c:3:1: error: expected ',' or ';' before 'for'
    3 | for i = 1 to A.length-1
      | ^~~
Language: C

A[6]={5,2,4,6,1,3}
for i = 1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected ',' or ';' before 'for'
    2 | for i = 1 to A.length-1
      | ^~~
Language: C

A[6]={5,2,4,6,1,3};
for i = 1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected identifier or '(' before 'for'
    2 | for i = 1 to A.length-1
      | ^~~
Language: C

A[6]={5,2,4,6,1,3};
for (i = 1 ;A.length-1;)
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected identifier or '(' before 'for'
    2 | for (i = 1 ;A.length-1;)
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | for (i = 1 ;A.length-1;)
      |              ^
main.c:2:24: error: expected identifier or '(' before ')' token
    2 | for (i = 1 ;A.length-1;)
      |                        ^
Language: C

A[6]={5,2,4,6,1,3};
for (i = 1 ;i<A.length-1;)
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected identifier or '(' before 'for'
    2 | for (i = 1 ;i<A.length-1;)
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | for (i = 1 ;i<A.length-1;)
      |              ^
main.c:2:26: error: expected identifier or '(' before ')' token
    2 | for (i = 1 ;i<A.length-1;)
      |                          ^
Language: C

A[6]={5,2,4,6,1,3}
for (i = 1 ;i<A.length-1;)
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected ',' or ';' before 'for'
    2 | for (i = 1 ;i<A.length-1;)
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | for (i = 1 ;i<A.length-1;)
      |              ^
main.c:2:26: error: expected identifier or '(' before ')' token
    2 | for (i = 1 ;i<A.length-1;)
      |                          ^
Language: C


  1 #include<stdio.h>                                                                                                                                                                                  
  2 main(){
  3         int i,j,key,N;
  4 
  5             scanf("%d ",&N);
  6                 int a[N];
  7                     for(i=0;i<N;i++){
  8                                 scanf("%d",&a[i]);
  9                                     }
 10 
 11                         for(j=1;j<N;j++){
 12                               for(i=0;i<N;i++){
 13                                   printf("%d",a[i]);
 14                               }
 15                               printf("\n");
 16                               key = a[j];
 17                               i=j-1;
 18                               while(i>=0 && a[i]>key){
 19                                   a[i+1]=a[i];
 20                                   i--;
 21                               }
 22 
 23                               a[i+1]=key;
 24                         }
 25 
 26                         for(i=0;i<N;i++){
 27                             printf("%d",a[i]);
 28                         }
 29                         printf("\n");
 30 }




Compiler output:
main.c:2:3: error: expected identifier or '(' before numeric constant
    2 |   1 #include<stdio.h>
      |   ^
main.c:2:5: error: stray '#' in program
    2 |   1 #include<stdio.h>
      |     ^
Language: C

A[6]={5,2,4,6,1,3}
for (i = 1 ;i<A.length-1;j--)
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected ',' or ';' before 'for'
    2 | for (i = 1 ;i<A.length-1;j--)
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | for (i = 1 ;i<A.length-1;j--)
      |              ^
main.c:2:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
    2 | for (i = 1 ;i<A.length-1;j--)
      |                           ^~
Language: C

A[6]={5,2,4,6,1,3};
for (i = 1 ;i<A.length-1;j--)
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected identifier or '(' before 'for'
    2 | for (i = 1 ;i<A.length-1;j--)
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | for (i = 1 ;i<A.length-1;j--)
      |              ^
main.c:2:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
    2 | for (i = 1 ;i<A.length-1;j--)
      |                           ^~
Language: C

#include<stdio.h>

int main() {
    
int A={3,5,1,4,8,7,2,9};
int i,j,v;
int A[];

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

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

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



Compiler output:
main.c: In function 'main':
main.c:5:10: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |          ^
main.c:5:10: note: (near initialization for 'A')
main.c:5:12: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |            ^
main.c:5:12: note: (near initialization for 'A')
main.c:5:14: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |              ^
main.c:5:14: note: (near initialization for 'A')
main.c:5:16: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |                ^
main.c:5:16: note: (near initialization for 'A')
main.c:5:18: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |                  ^
main.c:5:18: note: (near initialization for 'A')
main.c:5:20: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |                    ^
main.c:5:20: note: (near initialization for 'A')
main.c:5:22: warning: excess elements in scalar initializer
    5 | int A={3,5,1,4,8,7,2,9};
      |                      ^
main.c:5:22: note: (near initialization for 'A')
main.c:7:5: error: conflicting types for 'A'; have 'int[]'
    7 | int A[];
      |     ^
main.c:5:5: note: previous definition of 'A' with type 'int'
    5 | int A={3,5,1,4,8,7,2,9};
      |     ^
main.c:9:13: error: 'N' undeclared (first use in this function)
    9 | scanf("%d",&N);
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:17: error: 'a' undeclared (first use in this function)
   11 |     scanf("%d",&a);
      |                 ^
Language: C

#include<stdio.h>

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:6:5: error: array size missing in 'A'
    6 | int A[];
      |     ^
main.c:8:13: error: 'N' undeclared (first use in this function)
    8 | scanf("%d",&N);
      |             ^
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:17: error: 'a' undeclared (first use in this function)
   10 |     scanf("%d",&a);
      |                 ^
Language: C

#include<stdio.h>

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:6:5: error: array size missing in 'A'
    6 | int A[];
      |     ^
main.c:10:17: error: 'a' undeclared (first use in this function)
   10 |     scanf("%d",&a);
      |                 ^
main.c:10: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,a;
int A[];

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

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

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



Compiler output:
main.c: In function 'main':
main.c:6:5: error: array size missing in 'A'
    6 | int A[];
      |     ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:2:11: error: expected identifier or '(' before numeric constant
    2 | #define N 100
      |           ^~~
main.c:5:11: note: in expansion of macro 'N'
    5 | int i,j,v,N,a;
      |           ^
main.c:8:12: error: lvalue required as unary '&' operand
    8 | scanf("%d",&N);
      |            ^
main.c:10:17: error: 'a' undeclared (first use in this function)
   10 |     scanf("%d",&a);
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

1 insertionSort(A, N) // N個の要素を含む0-オリジンの配列A
2   for i が 1 から N-1 まで
3     v = A[i]
4     j = i - 1
5     while j >= 0 かつ A[j] <v
6       A[j+1] = A[j]
7       j--
8     A[j+1] = v


Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 1 insertionSort(A, N) // N個の要素を含む0-オリジンの配列A
      | ^
Language: C

A[6]={5,2,4,6,1,3};
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | A[6]={5,2,4,6,1,3};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:2:1: error: expected identifier or '(' before 'for'
    2 | for i=1 to A.length-1
      | ^~~
Language: C

#include <stdio.h>A[6]={5,2,4,6,1,3}
int main (int argc,char argv[])
{
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]
}


Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>A[6]={5,2,4,6,1,3}
      |                   ^
main.c: In function 'main':
main.c:4:5: error: expected '(' before 'i'
    4 | for i=1 to A.length-1
      |     ^
      |     (
main.c:4:5: error: 'i' undeclared (first use in this function)
main.c:4:5: 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;
    int s[1000];
    scanf("%d",&a);
    while(scanf("%d",&s[i]) != EOF)i++;
    for(i = 1;i < a-1;i++){
        b = s[i];
        j = i - 1;
        while(j>= 0 || s[j] > b){
        s[j+1] = s[j];
        j--;
        a[j+1]=b;
        }
        for(i = 0;i < a;i++){
        printf("%d ");
        }
        printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:15:10: error: subscripted value is neither array nor pointer nor vector
   15 |         a[j+1]=b;
      |          ^
Language: C

#include <stdio.h>
int main(argc,char argv[])
{
    [6]={5,2,4,6,1,3}
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]
}


Compiler output:
main.c:2:15: error: expected ')' before 'char'
    2 | int main(argc,char argv[])
      |               ^~~~
      |               )
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    [6]={5,2,4,6,1,3}
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]
}


Compiler output:
main.c: In function 'main':
main.c:4:5: error: expected expression before '[' token
    4 |     [6]={5,2,4,6,1,3}
      |     ^
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    [6]={5,2,4,6,1,3}
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:5: error: expected expression before '[' token
    4 |     [6]={5,2,4,6,1,3}
      |     ^
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    [6]={5,2,4,6,1,3};
    for (i=1 ;i<A.length-1;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j]
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:5: error: expected expression before '[' token
    4 |     [6]={5,2,4,6,1,3};
      |     ^
main.c:5:10: error: 'i' undeclared (first use in this function)
    5 |     for (i=1 ;i<A.length-1;j--){
      |          ^
main.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:17: error: 'A' undeclared (first use in this function)
    5 |     for (i=1 ;i<A.length-1;j--){
      |                 ^
main.c:5:28: error: 'j' undeclared (first use in this function)
    5 |     for (i=1 ;i<A.length-1;j--){
      |                            ^
main.c:6:9: error: 'key' undeclared (first use in this function)
    6 |         key=A[i];
      |         ^~~
main.c:9:24: error: expected ';' before '}' token
    9 |             A[j+1]=A[j]
      |                        ^
      |                        ;
   10 |          }
      |          ~              
main.c:11:19: error: expected ';' before '}' token
   11 |         A[j+1]=key
      |                   ^
      |                   ;
......
   14 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
   A[6]={5,2,4,6,1,3};
    for (i=1 ;i<A.length-1;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j]
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:4: error: 'A' undeclared (first use in this function)
    4 |    A[6]={5,2,4,6,1,3};
      |    ^
main.c:4:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:9: error: expected expression before '{' token
    4 |    A[6]={5,2,4,6,1,3};
      |         ^
main.c:5:10: error: 'i' undeclared (first use in this function)
    5 |     for (i=1 ;i<A.length-1;j--){
      |          ^
main.c:5:28: error: 'j' undeclared (first use in this function)
    5 |     for (i=1 ;i<A.length-1;j--){
      |                            ^
main.c:6:9: error: 'key' undeclared (first use in this function)
    6 |         key=A[i];
      |         ^~~
main.c:9:24: error: expected ';' before '}' token
    9 |             A[j+1]=A[j]
      |                        ^
      |                        ;
   10 |          }
      |          ~              
main.c:11:19: error: expected ';' before '}' token
   11 |         A[j+1]=key
      |                   ^
      |                   ;
......
   14 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j;
    for (i=1 ;i<A.length-1;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j]
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'i' undeclared (first use in this function)
    6 |     for (i=1 ;i<A.length-1;j--){
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:18: error: request for member 'length' in something not a structure or union
    6 |     for (i=1 ;i<A.length-1;j--){
      |                  ^
main.c:10:24: error: expected ';' before '}' token
   10 |             A[j+1]=A[j]
      |                        ^
      |                        ;
   11 |          }
      |          ~              
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j;
    for (i=1 ;i<(A.length-1);j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j]
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'i' undeclared (first use in this function)
    6 |     for (i=1 ;i<(A.length-1);j--){
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:19: error: request for member 'length' in something not a structure or union
    6 |     for (i=1 ;i<(A.length-1);j--){
      |                   ^
main.c:10:24: error: expected ';' before '}' token
   10 |             A[j+1]=A[j]
      |                        ^
      |                        ;
   11 |          }
      |          ~              
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j;
    for (i=1 ;i<((A.length)-1);j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'i' undeclared (first use in this function)
    6 |     for (i=1 ;i<((A.length)-1);j--){
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:20: error: request for member 'length' in something not a structure or union
    6 |     for (i=1 ;i<((A.length)-1);j--){
      |                    ^
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
#include N 100
#include 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:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include N 100
      |          ^
main.c:3:10: error: #include expects "FILENAME" or <FILENAME>
    3 | #include A 1000
      |          ^
main.c: In function 'main':
main.c:6:11: error: 'A' undeclared (first use in this function)
    6 |     int a[A];
      |           ^
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:11: error: expected expression before '%' token
    8 |     scanf(%d,&number);
      |           ^
main.c:10:15: error: expected expression before '%' token
   10 |         scanf(%d,&a[i]);
      |               ^
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);
      |                 ^
Language: C

#include<stdio.h>

int main(){
    int a,b;
    int i=0, j,k;
    int s[1000];
    scanf("%d",&a);
    while(scanf("%d",&s[i]) != EOF)i++;
    for(i = 1;i < a-1;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[c]);
        }
        printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:18:24: error: 'c' undeclared (first use in this function)
   18 |         printf("%d ",s[c]);
      |                        ^
main.c:18:24: 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 A[6]={5,2,4,6,1,3};
    int key,j,i;
    for (i=1 ;i<((A.length)-1);j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:20: error: request for member 'length' in something not a structure or union
    6 |     for (i=1 ;i<((A.length)-1);j--){
      |                    ^
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j,i;
    for (i=1 ;i<=6j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:20: error: lvalue required as decrement operand
    6 |     for (i=1 ;i<=6j--){
      |                    ^~
main.c:6:22: error: expected ';' before ')' token
    6 |     for (i=1 ;i<=6j--){
      |                      ^
      |                      ;
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
# N 100
# 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:2:3: error: invalid preprocessing directive #N
    2 | # N 100
      |   ^
main.c:3:3: error: invalid preprocessing directive #A
    3 | # A 1000
      |   ^
main.c: In function 'main':
main.c:6:11: error: 'A' undeclared (first use in this function)
    6 |     int a[A];
      |           ^
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:11: error: expected expression before '%' token
    8 |     scanf(%d,&number);
      |           ^
main.c:10:15: error: expected expression before '%' token
   10 |         scanf(%d,&a[i]);
      |               ^
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);
      |                 ^
Language: C

#include <stdio.h>
int main(int argc,char argv[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j,i;
    for (i=1 ;i<=6;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
Language: C

#include <stdio.h>
int main(int argc,char *args[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j,i;
    for (i=1 ;i<=6;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
     }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |      }
      |      ~
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:8:11: error: expected expression before '%' token
    8 |     scanf(%d,&number);
      |           ^
main.c:10:15: error: expected expression before '%' token
   10 |         scanf(%d,&a[i]);
      |               ^
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(int argc,char *args[])
{
    int A[6]={5,2,4,6,1,3};
    int key,j,i;
    for (i=1 ;i<=6;j--){    
        key=A[i];
        j=i-1;
        while (j>=0 &&A[j]>key){
            A[j+1]=A[j];
         }
        A[j+1]=key
     //for a=0 to
     //printf a[i]
    }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:19: error: expected ';' before '}' token
   12 |         A[j+1]=key
      |                   ^
      |                   ;
......
   15 |     }
      |     ~