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

#include <stdio.h>

void selectionSort(int A[], int N) {
    int i, j;
    int tmp, minj;
    int c = 0;
    for (i = 0; i < N; i++) {
        minj = i;
        for (j = i; j < N; j++) {
            if (A[j] < A[minj])
                minj = j;
        }

        if (i != minj) {
            tmp = A[i];
            A[i] = A[minj];
            A[minj] = tmp;

            c++;
        }
    }
    for (i = 0; i < N; i++) {
        printf("%d", A[i]);
        if (i != N-1)
            printf(" ");
        else
            printf("\n%d\n", c);
    }
}

int main() {
    int N, A[101];

    scanf("%d", &N);

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

    selectionSort(A, N);

    return 0;
}

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

#include <stdio.h>

int main()
{
  int n, i, j, k, swap, min;
  int a[100];
  k = 0;

  scanf("%d", &n);

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

  for(i = 0; i < n-1; i++){
    min = i;
    for(j = 1; j < n; j++){
      if( a[j] < a[min])
        min = j;
    if(a[i] > a[min]){
      swap = a[i];
      a[i] = a[min];
      a[min] = swap;
      k++;
    }
  }

  for(i = 0; i < n; i++)
    printf("%d ", a[i]);

  printf("\n");

  printf("%d\n", k);

  return 0;
}

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

#include<stdio.h>

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

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

   sw = 0;

   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (A[j]<A[minj])
            minj = j;
         tmp = A[minj];
         A[minj] = A[i];
         A[i] = tmp;
         if (i!=minj)
            sw++;
   }

   for (i=0; i<N-1; i++)
      printf("%d ", A[i]);

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

   printf("%d\n", sw);

   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,mini,a[100],n,temp;
  scanf("%d",&n);
  for (i = 0; i < n ; i++) {
    scanf("%d",a[i]);
  }
  for (i = 0; i < n-1; i++) {
    mini = i;
    for (j = i+1; j < n; j++) {
      if(mini > a[j])
        mini = j;
    }
      temp = a[i];
      a[i] = a[mini];
      a[mini] = temp;  
   }
  return 0;
}
    
    

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

#include<stdio.h>

int main()
{
  int i,mini,a[100],n,temp;
  scanf("%d",&n);
  for (i = 0; i < n ; i++) {
    scanf("%d",&a[i]);
  }
  for (i = 0; i < n-1; i++) {
    mini = i;
    for (j = i+1; j < n-1; j++) {
      if(mini > a[j])
        mini = j;
    }
      temp = a[i];
      a[i] = a[mini];
      a[mini] = temp;  
   }
  for (i = 0; I < n; i++)
  printf("%d \n",a[i]);
  return 0;
}
    
    

Compiler output:
main.c: In function 'main':
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |     for (j = i+1; j < n-1; j++) {
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:15: error: 'I' undeclared (first use in this function)
   20 |   for (i = 0; I < n; i++)
      |               ^
Language: C

#include<stdio.h>

int main()
{
  int i,mini,a[100],n,temp;
  scanf("%d",&n);
  for (i = 0; i < n ; i++) {
    scanf("%d",&a[i]);
  }
  for (i = 0; i < n; i++) {
    mini = i;
    for (j = i; j < n; j++) {
      if(a[mini] > a[j])
        mini = j;
    }
      temp = a[i];
      a[i] = a[mini];
      a[mini] = temp;  
   }
  for (i = 0; i < n; i++)
  printf("%d \n",a[i]);
  return 0;
}
    
    

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

#include<stdio.h>

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[min]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

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

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

  return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:10:27: error: 'min' undeclared (first use in this function); did you mean 'minj'?
   10 |     t=A[i];A[i]=A[minj];A[min]=t;
      |                           ^~~
      |                           minj
main.c:10:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[minj]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

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

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

  sw=selectionSort(A,N);

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:35: error: expected ')' before ';' token
   20 |   for(i=0;i<N;i++)scanf("%d",&A[i];);
      |                        ~          ^
      |                                   )
Language: C

#include<stdio.h>

int main () {

   int n, i, j, minj, swap;
   int a[100] = {0};
   int count = 0;

   scanf("%d",&n);

   for (i = 0; i < n; i++) {
      minj = i;
   
      for (j = i; j < n; j++) {
         if(a[j] < a[minj])
            minj = j;
      }
      if(i != minj){
         swap = a[i];
         a[i] = a[minj];
         a[minj] = swap;
         count++;
   }

   for(i = 0; i < n; i++){
      printf(" %d",a[i]);
   }

   printf("\n");

   printf("%d", count);


   return 0
}

Compiler output:
main.c: In function 'main':
main.c:34:12: error: expected ';' before '}' token
   34 |    return 0
      |            ^
      |            ;
   35 | }
      | ~           
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C

#include <stdio.h>

int insertionSort(int A[], int N){
  int i, j, t; sw = 0; minj;
  for (i = 0; i < N; i++){
    minj = i;
    for (j = i; j < N; j++){
      if (A[j] < A[minj])minj = j;
    }
    t = A[i]; A[i] = A[minj]; A[minj] = t;
    if (i != minj)sw++;
   }
   return sw;
}

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

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

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

  return 0;
}
       

Compiler output:
main.c: In function 'insertionSort':
main.c:4:16: error: 'sw' undeclared (first use in this function)
    4 |   int i, j, t; sw = 0; minj;
      |                ^~
main.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:24: error: 'minj' undeclared (first use in this function)
    4 |   int i, j, t; sw = 0; minj;
      |                        ^~~~
main.c: In function 'main':
main.c:22:8: error: implicit declaration of function 'selectionSort'; did you mean 'insertionSort'? [-Wimplicit-function-declaration]
   22 |   sw = selectionSort(A, N);
      |        ^~~~~~~~~~~~~
      |        insertionSort
Language: C

#include <stdio.h>

int selectionSort(int A[], int N){
  int i, j, t; sw = 0; minj;
  for (i = 0; i < N; i++){
    minj = i;
    for (j = i; j < N; j++){
      if (A[j] < A[minj])minj = j;
    }
    t = A[i]; A[i] = A[minj]; A[minj] = t;
    if (i != minj)sw++;
   }
   return sw;
}

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

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

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

  return 0;
}
       

Compiler output:
main.c: In function 'selectionSort':
main.c:4:16: error: 'sw' undeclared (first use in this function)
    4 |   int i, j, t; sw = 0; minj;
      |                ^~
main.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:24: error: 'minj' undeclared (first use in this function)
    4 |   int i, j, t; sw = 0; minj;
      |                        ^~~~
Language: C

#include<stdio.h>

void selectionSort(int A[100], int n)
{
  int i, j, minj, swap, cnt;
  cnt = 0;

  for(i=0; i<n; i++){
    minj = i;
    for(j=i; j<n; j++){
      if(A[j] < A[minj]{
        minj = j;
      }
    swap = A[i];
    A[i] = A[minj];
    A[minj] = swap;
    cnt++;
    }
  printf("%d", A[0]);
  for(i=1; i<n; i++){
    printf(" %d", A[i]);
  }
  printf("\n");
}


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

  scanf("%d", &N);

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

  selectionSort(A,N);

  return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:11:24: error: expected ')' before '{' token
   11 |       if(A[j] < A[minj]{
      |         ~              ^
      |                        )
main.c:18:5: error: expected expression before '}' token
   18 |     }
      |     ^
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>

void selectionSort(int A[100], int n)
{
  int i, j, minj, swap, cnt;
  cnt = 0;

  for(i=0; i<n; i++){
    minj = i;
    for(j=i; j<n; j++){
      if(A[j] < A[minj]){
        minj = j;
      }
    swap = A[i];
    A[i] = A[minj];
    A[minj] = swap;
    cnt++;
    }
  printf("%d", A[0]);
  for(i=1; i<n; i++){
    printf(" %d", A[i]);
  }
  printf("\n");
}


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

  scanf("%d", &N);

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

  selectionSort(A,N);

  return 0;
}

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

#include<stdio.h>

int main (){
   int n, i, j, minj, swap;
   int a[100] = {0};
   int count = 0;


   scanf("%d", &n);

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

   for(i = 0; i < n; i++){
      minj = i
      for(j = i; j < n; j++){
         if(a[j] < a[minj]){
            minj = j;
         }
         if(i != minj){
            swap = a[i];
            a[i] = a[minj];
            a[minj] = a[i];
            count++;
         }
   }

   for(i = 0; i < n; i++){
      if(i == n-1){
         printf("%d\n", a[i]);
      } else {
         printf("%d ", a[i]);
      }
   }
  
   print("%d", count);

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:15: error: expected ';' before 'for'
   16 |       minj = i
      |               ^
      |               ;
   17 |       for(j = i; j < n; j++){
      |       ~~~      
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>

int main (){
   int n, i, j, minj, swap;
   int a[100] = {0};
   int count = 0;


   scanf("%d", &n);

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

   for(i = 0; i < n; i++){
      minj = i;
      for(j = i; j < n; j++){
         if(a[j] < a[minj]){
            minj = j;
         }
         if(i != minj){
            swap = a[i];
            a[i] = a[minj];
            a[minj] = a[i];
            count++;
         }
   }

   for(i = 0; i < n; i++){
      if(i == n-1){
         printf("%d\n", a[i]);
      } else {
         printf("%d ", a[i]);
      }
   }
  
   print("%d", count);

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:37:4: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   37 |    print("%d", count);
      |    ^~~~~
      |    printf
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>

int main (){
   int n, i, j, minj, swap;
   int a[100] = {0};
   int count = 0;


   scanf("%d", &n);

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

   for(i = 0; i < n; i++){
      minj = i;
      for(j = i; j < n; j++){
         if(a[j] < a[minj]){
            minj = j;
         }
      }
      if(i != minj){
         swap = a[i];
         a[i] = a[minj];
         a[minj] = a[i];
         count++;
      }
   }

   for(i = 0; i < n; i++){
      if(i == n-1){
         printf("%d\n", a[i]);
      } else {
         printf("%d ", a[i]);
      }
   }
  
   print("%d", count);

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:38:4: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   38 |    print("%d", count);
      |    ^~~~~
      |    printf
Language: C

#include <sdio.h>

int selectionSort(int A[], int N) {

   int i, j, t, sw = 0, miji;

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

   t = A[i];
   A[i] = A[miji];
   A[miji] = t;

   if (i != miji) sw++;
   }

   return sw;
}


int main() { 

   int A[100], N, i, sw;

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

   sw = selectionSort(A, N);

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

   return 0;

}

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

#include <stdio.h>

int selectsort(int a[],int N){
  int i,j,s,z,minj;
  s=0;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N-1;j++){
      if(a[j]<a[minj){
        minj=j;
      }
    }
    z=a[i];
    a[i]=a[minj];
    a[minj]=z;
    if(i!=minj){
       s++;
    }
  }
  return s;
}

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

  printf("%d\n",s);
  return 0;
}

    

Compiler output:
main.c: In function 'selectsort':
main.c:10:21: error: expected ']' before ')' token
   10 |       if(a[j]<a[minj){
      |                     ^
      |                     ]
Language: C

#include <stdio.h>
??
int selectsort(int a[],int N){
????int i,j,s,z,minj;
????s=0;
????z=0;
????for(i=0;i<N-1;i++){
????????minj=i;
????????for(j=i;j<N-1;j++){
????????????if(a[j]<a[minj]){
????????????????minj=j;
????????????}
????????}
????????z=a[i];
????????a[i]=a[minj];
????????a[minj]=z;
????????if(i!=minj){
??????????????s++;
????????}
????}
????return s;
}
??
int main(void)
{
????int i,j,N,s,a[100];
????scanf("%d",&N);
????for(i=0;i<N;i++){
????????scanf("%d",&a[i]);
????}
????s=selectsort(a,N);
????for(i=0;i<N;i++){
????????if(i>0){
????????????printf(" ");
????????}
????????printf("%d",a[i]);
????}
????printf("\n");
??
????printf("%d\n",s);
????return 0;
}
??
????????

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:23:1: error: expected identifier or '(' before '?' token
   23 | ??
      | ^
main.c:43:1: error: expected identifier or '(' before '?' token
   43 | ??
      | ^
Language: C

#include <stdio.h>
??
int selectsort(int a[],int N){
  int i,j,s,z,minj;
  s=0;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N-1;j++){
      if(a[j]<a[minj){
        minj=j;
      }
    }
    z=a[i];
    a[i]=a[minj];
    a[minj]=z;
    if(i!=minj){
      s++;
    }
  }
  return s;
}
??
int main(void)
{
  int i,j,N,s,a[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  s=selectsort(a,N);
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("\n");
  
  printf("%d\n",s);
  return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:23:1: error: expected identifier or '(' before '?' token
   23 | ??
      | ^
Language: C

#include <stdio.h>
??
int selectsort(int a[],int N){
  int i,j,s,z,minj;
  s=0;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N-1;j++){
      if(a[j]<a[minj){
        minj=j;
      }
    }
    z=a[i];
    a[i]=a[minj];
    a[minj]=z;
    if(i!=minj){
      s++;
    }
  }
  return s;
}
??
int main(void)
{
  int i,N,s,a[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  s=selectsort(a,N);
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("\n");
  printf("%d\n",s);

  return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:23:1: error: expected identifier or '(' before '?' token
   23 | ??
      | ^
Language: C

#include <stdio.h>

int selectsort(int a[],int N){
  int i,j,s,z,minj;
  s=0;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N-1;j++){
      if(a[j]<a[minj){
        minj=j;
      }
    }
    z=a[i];
    a[i]=a[minj];
    a[minj]=z;
    if(i!=minj){
      s++;
    }
  }
  return s;
}
??
int main(void)
{
  int i,N,s,a[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  s=selectsort(a,N);
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("\n");
  printf("%d\n",s);

  return 0;
}

Compiler output:
main.c: In function 'selectsort':
main.c:10:21: error: expected ']' before ')' token
   10 |       if(a[j]<a[minj){
      |                     ^
      |                     ]
main.c: At top level:
main.c:23:1: error: expected identifier or '(' before '?' token
   23 | ??
      | ^
Language: C

#include <stdio.h>

int main(void)
{
   int N, i, j, minj, tmp;
   int wa = 0;
   int A[100];

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

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

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

   reutrn 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:4: error: 'reutrn' undeclared (first use in this function)
   35 |    reutrn 0;
      |    ^~~~~~
main.c:35:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:10: error: expected ';' before numeric constant
   35 |    reutrn 0;
      |          ^~
      |          ;
Language: C

#includestdio.h>

int selectionSort(int a[], int N){
  int i, j, temp, minj;
  int sw = 0;

  for (i=0; i<N; i++) {
    minj = i;
    for (j=1; j<N; j++) {
      if (a[j] < a[minj])
        minj = j;
    }
    temp    = a[i];
    a[i]    = a[minj];
    a[minj] = temp;
    if (i != minj)
      sw++;
  }
  return sw;
}

int main(){
  int a[100], N, i, sw;

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

  sw = selectionSort(a, N);

  for (i-0; i<N; i++) {
    if (i>0)
      putchar(' ');
    printf("%d", a[i]);
  }
  printf("\n%d\n", sw);

  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includestdio
    1 | #includestdio.h>
      |  ^~~~~~~~~~~~
main.c: In function 'main':
main.c:25:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   25 |   scanf("%d", &N);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includestdio.h>
main.c:25:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   25 |   scanf("%d", &N);
      |   ^~~~~
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:33:7: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
   33 |       putchar(' ');
      |       ^~~~~~~
main.c:33:7: note: include '<stdio.h>' or provide a declaration of 'putchar'
main.c:34:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |     printf("%d", a[i]);
      |     ^~~~~~
main.c:34:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:34:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:36:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   36 |   printf("\n%d\n", sw);
      |   ^~~~~~
main.c:36:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

int main()
{
  int n, int data[99], i, j,  minj, A, count;
  ocunt = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
 }

Compiler output:
main.c: In function 'main':
main.c:5:10: error: expected identifier or '(' before 'int'
    5 |   int n, int data[99], i, j,  minj, A, count;
      |          ^~~
main.c:6:3: error: 'ocunt' undeclared (first use in this function)
    6 |   ocunt = 0;
      |   ^~~~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i = 0; i < n; i++){
      |       ^
main.c:10:18: error: 'data' undeclared (first use in this function)
   10 |     scanf("%d", &data[i]);
      |                  ^~~~
main.c:14:5: error: 'minj' undeclared (first use in this function)
   14 |     minj = i;
      |     ^~~~
main.c:15:9: error: 'j' undeclared (first use in this function)
   15 |     for(j = i; j < n; j++){
      |         ^
main.c:16:31: error: expected ')' before '{' token
   16 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:23:5: error: expected expression before '}' token
   23 |     }
      |     ^
main.c:30:20: error: 'count' undeclared (first use in this function)
   30 |   printf("\n%d\n", count);
      |                    ^~~~~
Language: C

#include<stdio.h>

int main()
{
  int n, int data[99], i, j,  minj, A, count;
  count = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
 }

Compiler output:
main.c: In function 'main':
main.c:5:10: error: expected identifier or '(' before 'int'
    5 |   int n, int data[99], i, j,  minj, A, count;
      |          ^~~
main.c:6:3: error: 'count' undeclared (first use in this function)
    6 |   count = 0;
      |   ^~~~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i = 0; i < n; i++){
      |       ^
main.c:10:18: error: 'data' undeclared (first use in this function)
   10 |     scanf("%d", &data[i]);
      |                  ^~~~
main.c:14:5: error: 'minj' undeclared (first use in this function)
   14 |     minj = i;
      |     ^~~~
main.c:15:9: error: 'j' undeclared (first use in this function)
   15 |     for(j = i; j < n; j++){
      |         ^
main.c:16:31: error: expected ')' before '{' token
   16 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:23:5: error: expected expression before '}' token
   23 |     }
      |     ^
Language: C

#include<stdio.h>

int main()
{
  int n, i, j,  minj, A, count;

  int data[99};
  count = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
 }

Compiler output:
main.c: In function 'main':
main.c:7:14: error: expected ']' before '}' token
    7 |   int data[99};
      |              ^
      |              ]
main.c:12:18: error: 'data' undeclared (first use in this function)
   12 |     scanf("%d", &data[i]);
      |                  ^~~~
main.c:12:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:31: error: expected ')' before '{' token
   18 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:25:5: error: expected expression before '}' token
   25 |     }
      |     ^
Language: C

#include<stdio.h>

int main()
{
  int n, i, j,  minj, A, count;
  int data[99};
  count = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
 }

Compiler output:
main.c: In function 'main':
main.c:6:14: error: expected ']' before '}' token
    6 |   int data[99};
      |              ^
      |              ]
main.c:11:18: error: 'data' undeclared (first use in this function)
   11 |     scanf("%d", &data[i]);
      |                  ^~~~
main.c:11:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:31: error: expected ')' before '{' token
   17 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:24:5: error: expected expression before '}' token
   24 |     }
      |     ^
Language: C

#include<stdio.h>

int main()
{
  int n, i, j,  minj, A, count;
  int data[99];
  count = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
 }

Compiler output:
main.c: In function 'main':
main.c:17:31: error: expected ')' before '{' token
   17 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:24:5: error: expected expression before '}' token
   24 |     }
      |     ^
Language: C

#include<stdio.h>

int main()
{
  int n, i, j,  minj, A, count;
  int data[99];
  count = 0;
   
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &data[i]);
  }
  
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if (data[j] < data[minj]{
        minj = j;
        A = data[j];
        data[j] = data[minj];
        data[minj] = A;
        count++;
      }
    }
  }
  
  printf("%d", data[0]);
  for(i = 1; i < n; i++){
    printf(" %d", data[i]);
  }
  printf("\n%d\n", count);
}

Compiler output:
main.c: In function 'main':
main.c:17:31: error: expected ')' before '{' token
   17 |       if (data[j] < data[minj]{
      |          ~                    ^
      |                               )
main.c:24:5: error: expected expression before '}' token
   24 |     }
      |     ^
Language: C

#include <stdio.h>

int main(void)
{

int N;

scanf("%d",&N);

int A[N+1]:
int i, j, hozon,min;
int count=0;

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

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

min = i;

for(j=i; j<N; j++)
{
if(A[min] > A[j]){
min = j;
}

}

if(min != i)
{
hozon = A[i];
A[i] = A[min];
A[min] = hozon;
count++;
}

}

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

if(i > 0)
printf(" ");

printf("%d", A[i]);
}

printf("\n");
printf("%d\n", count);
return 0;

}
 

Compiler output:
main.c: In function 'main':
main.c:10:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   10 | int A[N+1]:
      |           ^
main.c:10:11: error: expected expression before ':' token
main.c:14:5: error: 'i' undeclared (first use in this function)
   14 | for(i=0; i<N; i++)
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:13: error: 'A' undeclared (first use in this function)
   16 | scanf("%d",&A[i]);
      |             ^
main.c:22:1: error: 'min' undeclared (first use in this function); did you mean 'main'?
   22 | min = i;
      | ^~~
      | main
main.c:24:5: error: 'j' undeclared (first use in this function)
   24 | for(j=i; j<N; j++)
      |     ^
main.c:34:1: error: 'hozon' undeclared (first use in this function)
   34 | hozon = A[i];
      | ^~~~~
Language: C

#include <stdio.h>

int main(void)
{

int N;

scanf("%d",&N);

int A[N+1]:
int i, j, hozon,min;
int count=0;

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

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

min = i;

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

if(A[min] > A[j])
{
min = j;
}

}

if(min != i)
{
hozon = A[i];
A[i] = A[min];
A[min] = hozon;
count++;
}

}

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

printf("\n");
printf("%d\n", count);
return 0;

}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   10 | int A[N+1]:
      |           ^
main.c:10:11: error: expected expression before ':' token
main.c:14:5: error: 'i' undeclared (first use in this function)
   14 | for(i=0; i<N; i++)
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:13: error: 'A' undeclared (first use in this function)
   16 | scanf("%d",&A[i]);
      |             ^
main.c:22:1: error: 'min' undeclared (first use in this function); did you mean 'main'?
   22 | min = i;
      | ^~~
      | main
main.c:24:5: error: 'j' undeclared (first use in this function)
   24 | for(j=i; j<N; j++)
      |     ^
main.c:36:1: error: 'hozon' undeclared (first use in this function)
   36 | hozon = A[i];
      | ^~~~~
Language: C

#include <stdio.h>

int main()
{

int N;

scanf("%d",&N);

int A[N+1]:
int i, j, hozon,min;
int count=0;

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

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

min = i;

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

if(A[min] > A[j])
{
min = j;
}

}

if(min != i)
{
hozon = A[i];
A[i] = A[min];
A[min] = hozon;
count++;
}

}

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

printf("\n");
printf("%d\n", count);
return 0;

}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   10 | int A[N+1]:
      |           ^
main.c:10:11: error: expected expression before ':' token
main.c:14:5: error: 'i' undeclared (first use in this function)
   14 | for(i=0; i<N; i++)
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:13: error: 'A' undeclared (first use in this function)
   16 | scanf("%d",&A[i]);
      |             ^
main.c:22:1: error: 'min' undeclared (first use in this function); did you mean 'main'?
   22 | min = i;
      | ^~~
      | main
main.c:24:5: error: 'j' undeclared (first use in this function)
   24 | for(j=i; j<N; j++)
      |     ^
main.c:36:1: error: 'hozon' undeclared (first use in this function)
   36 | hozon = A[i];
      | ^~~~~
Language: C

#include<stdio.h>
int main(void)
{
 int N,i,j,k,min,A[N+1];
 int count = 0;
 scanf("%d", &N);
 
 for(i = 0; i < N; i++);
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  min = i;
 for(j = 1; j < N; j++)
{
 if(A[min] > A[j])
{
 min = j;
}
}
 if(min != i)
{
  hozon = A[i];
  A[i] = A[min];
  A[min] = k;
  count++;
}
}
 for(i = 0; i < N; i++)
{
 if(i > 0)
 printf(" ");
 printf("%d",A[i])
}
 printf("\n");
 printf("%d\n",count);
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:24:3: error: 'hozon' undeclared (first use in this function)
   24 |   hozon = A[i];
      |   ^~~~~
main.c:24:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:19: error: expected ';' before '}' token
   34 |  printf("%d",A[i])
      |                   ^
      |                   ;
   35 | }
      | ~
Language: C

#include<stdio.h>
int main(void)
{
 int N,i,j,k,min,A[N+1];
 int count = 0;
 scanf("%d", &N);
 
 for(i = 0; i < N; i++);
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  min = i;
 for(j = 1; j < N; j++)
{
 if(A[min] > A[j])
{
 min = j;
}
}
 if(min != i)
{
  k = A[i];
  A[i] = A[min];
  A[min] = k;
  count++;
}
}
 for(i = 0; i < N; i++)
{
 if(i > 0)
 printf(" ");
 printf("%d",A[i])
}
 printf("\n");
 printf("%d\n",count);
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:34:19: error: expected ';' before '}' token
   34 |  printf("%d",A[i])
      |                   ^
      |                   ;
   35 | }
      | ~
Language: C

#include<stdio.h>
int main(void)
{
 int N,i,j,k,min,A[N+1];
 int count = 0;
 scanf("%d", &N);
 
 for(i = 0; i < N; i++);
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  min = i;
 for(j = 1; j < N; j++)
{
 if(A[min] > A[j])
{
 min = j;
}
}
 if(min != i)
{
  k = A[i];
  A[i] = A[min];
  A[min] = k;
  count++;
}
}
 for(i = 0; i < N; i++)
{
 if(i > 0){
 printf(" ");
 printf("%d",A[i])
}
 printf("\n");
 printf("%d\n",count);
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:34:19: error: expected ';' before '}' token
   34 |  printf("%d",A[i])
      |                   ^
      |                   ;
   35 | }
      | ~                  
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>
int main(void)
{
 int N,i,j,k,min,A[N+1];
 int count = 0;
 scanf("%d", &N);
 
 for(i = 0; i < N; i++);
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  min = i;
 for(j = 1; j < N; j++)
{
 if(A[min] > A[j])
{
 min = j;
}
}
 if(min != i)
{
  k = A[i];
  A[i] = A[min];
  A[min] = k;
  count++;

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

}

Compiler output:
main.c: In function 'main':
main.c:34:19: error: expected ';' before '}' token
   34 |  printf("%d",A[i])
      |                   ^
      |                   ;
   35 | }
      | ~                  
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>
int main(void)
{
 int N;
 scanf("%d", &N);
 int i,j,hozon,min,A[N+1];
 int count = 0;
  
 for(i = 0; i < N; i++);
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  min = i;
 for(j = 1; j < N; j++)
{
 if(A[min] > A[j])
{
 min = j;
}
}
 if(min != i)
{
  k = A[i];
  A[i] = A[min];
  A[min] = hozon;
  count++;
}
}
 for(i = 0; i < N; i++)
{
 if(i > 0)
 printf(" ");
 printf("%d",A[i]);
}
 printf("\n");
 printf("%d\n",count);
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:25:3: error: 'k' undeclared (first use in this function)
   25 |   k = A[i];
      |   ^
main.c:25:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void)
{
 int N;
 scanf("%d", &N);
 int i,j,hozon,minj,A[N+1];
 int count = 0;
  
 for(i = 0; i < N; i++)
{
 scanf("%d",A[i]);
}
 for(i = 0; i < N; i++)
{
  minj = i;
 for(j = i; j < N; j++)
{
 if(A[minj] > A[j])
{
 minj = j;
}
}
 if(minj != i)
{
  hozon = A[i];
  A[i] = A[min];
  A[min] = hozon;
  count++;
}
}
 for(i = 0; i < N; i++)
{
 if(i > 0)
 printf(" ");
 printf("%d",A[i]);
}
 printf("\n");
 printf("%d\n",count);
 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:26:12: error: 'min' undeclared (first use in this function); did you mean 'minj'?
   26 |   A[i] = A[min];
      |            ^~~
      |            minj
main.c:26:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


int main(void){
 
int i,j,N,minj,v,a[10000]; 
int c =0;

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

        printf("%d", a[i]);
}
printf("\n");
  
    

    printf("%d\n",c);

    return 0;
}
 
void selectionSort(int a[],int N){
    int i,j,minj,v;

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

            if ( a[j] < a[minj] ) {
      minj=j;
}
}
if(!=minj){
               v = a[i];
                a[i] = a[minj];
                a[minj] = v;
                
               
c++;
            }
        }
    }

Compiler output:
main.c: In function 'main':
main.c:15:1: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   15 | selectionSort(a,N);
      | ^~~~~~~~~~~~~
main.c: At top level:
main.c:33:6: warning: conflicting types for 'selectionSort'; have 'void(int *, int)'
   33 | void selectionSort(int a[],int N){
      |      ^~~~~~~~~~~~~
main.c:15:1: note: previous implicit declaration of 'selectionSort' with type 'void(int *, int)'
   15 | selectionSort(a,N);
      | ^~~~~~~~~~~~~
main.c: In function 'selectionSort':
main.c:44:4: error: expected expression before '!=' token
   44 | if(!=minj){
      |    ^~
main.c:50:1: error: 'c' undeclared (first use in this function)
   50 | c++;
      | ^
main.c:50:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


int main(void){
 
int i,j,N,minj,v,a[10000]; 
int c =0;

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

        printf("%d", a[i]);
}
printf("\n");
  
    

    printf("%d\n",c);

    return 0;
}
 
void selectionSort(int a[],int N){
    int i,j,minj,v;

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

            if ( a[j] < a[minj] ) {
      minj=j;
}
}
if(i!=minj){
               v = a[i];
                a[i] = a[minj];
                a[minj] = v;
                
               
c++;
            }
        }
    }

Compiler output:
main.c: In function 'main':
main.c:15:1: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   15 | selectionSort(a,N);
      | ^~~~~~~~~~~~~
main.c: At top level:
main.c:33:6: warning: conflicting types for 'selectionSort'; have 'void(int *, int)'
   33 | void selectionSort(int a[],int N){
      |      ^~~~~~~~~~~~~
main.c:15:1: note: previous implicit declaration of 'selectionSort' with type 'void(int *, int)'
   15 | selectionSort(a,N);
      | ^~~~~~~~~~~~~
main.c: In function 'selectionSort':
main.c:50:1: error: 'c' undeclared (first use in this function)
   50 | c++;
      | ^
main.c:50:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


int main(void){
 
int i,j,N,minj,v,a[10000]; 
int c =0;

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

            if ( a[j] < a[minj] ) {
      minj=j;
}
}
if(!=minj){
               v = a[i];
                a[i] = a[minj];
                a[minj] = v;
                
               
c++;
            }
        }
    
   
    for ( i = 0; i < N; i++ ) {
if(i>0){
printf(" ");
}

        printf("%d", a[i]);
}
printf("\n");
  
    

    printf("%d\n",c);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:4: error: expected expression before '!=' token
   23 | if(!=minj){
      |    ^~
Language: C

int main(){
  int A[100];
  int N;;
  fgets(A, 100, stdin);
  bubbleSort(A[], N);
}

void bubbleSort(int A[], int N){
  int i, j, tmp;
  for(i=0; i<(N - 1); i++){
    for(j=(N - 1); j>i; j--){
      if(A[j-1] > A[j]){
        temp = A[j-1];
        A[j-1] = A[j];
        A[j] = tmp;
      }
    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    4 |   fgets(A, 100, stdin);
      |   ^~~~~
main.c:4:17: error: 'stdin' undeclared (first use in this function)
    4 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:4:17: note: each undeclared identifier is reported only once for each function it appears in
    4 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:5:3: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
    5 |   bubbleSort(A[], N);
      |   ^~~~~~~~~~
main.c:5:16: error: expected expression before ']' token
    5 |   bubbleSort(A[], N);
      |                ^
main.c: At top level:
main.c:8:6: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
    8 | void bubbleSort(int A[], int N){
      |      ^~~~~~~~~~
main.c:5:3: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
    5 |   bubbleSort(A[], N);
      |   ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:13:9: error: 'temp' undeclared (first use in this function); did you mean 'tmp'?
   13 |         temp = A[j-1];
      |         ^~~~
      |         tmp
Language: C

#include <stdio.h>

int main(){
  int num;
  int a[100];
  int i, j, swap, read;
  int count = 0;
  int min_i, min;

  scanf("%d", &num);
  for(i = 0; i < num; i++) {
    scanf("%d", &read);
    a[i] = read;
  }
  if(num == 1) printf("%d", a[0]);
  else{
  for(i = 0; i < num-1; i++){
    min_i = i; min = a[i];
    for(j = i+1; j < num; j++) if(min > a[j]) min_i = j;
    if(i != min_i){
      swap = a[i];
      a[i] = a[min_i];
      a[min_i] = swap;
      count++;
    }
    printf("%d ", a[i]);
    if(i == num-2) printf("%d", a[num-1]);
  }
  }
  printf("\n%d\n", count);

  return 0;

Compiler output:
main.c: In function 'main':
main.c:32:3: error: expected declaration or statement at end of input
   32 |   return 0;
      |   ^~~~~~
Language: C

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


void selectionSort(int *A,int  N){
int i,j,n,minj;

 for(i = 0;i<N;i++){
        minj=i;
        for(j=i;j<N;j++){
                if(A[j]<A[minj]){
                minj=j;
        }
        n=A[i];
        A[i]=A[minj];
        A[minj]=n;
 }
}
}

int main(void){
 int N;
 int *A;

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

selectionSort(A,N);

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

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

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


int selectionSort(int *A,int  N){
int i,j,n,minj,x=0;

 for(i = 0;i<N;i++){
        minj=i;
        for(j=i;j<N;j++){
                if(A[j]<A[minj]){
                minj=j;
        }}
        if(i!=minj){
        n=A[i];
        A[i]=A[minj];
        A[minj]=n;
        x++;
        }
 }
return x;
}

int main(void){
 int N,x;
 int *A;

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

x=selectionSort(A,N);

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

free(A);
return 0;
}

~  

Compiler output:
main.c:46:1: error: expected identifier or '(' before '~' token
   46 | ~
      | ^
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 intsertionSort(int A[], int N){
    int i,j,minj;
    for(i=1;i<=N-1;i++){
        minj = i;
        for(j=i;j<=N-1){
            if A[j] < A[minj]{
                minj = j;
            }
        }
        A[minj]=A[i];
        trace (A, N);
    }
}

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

Compiler output:
main.c: In function 'intsertionSort':
main.c:17:23: error: expected ';' before ')' token
   17 |         for(j=i;j<=N-1){
      |                       ^
      |                       ;
main.c:18:16: error: expected '(' before 'A'
   18 |             if A[j] < A[minj]{
      |                ^
      |                (
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 intsertionSort(int A[], int N){
    int i,j,minj;
    for(i=1;i<=N-1;i++){
        minj = i;
        for(j=i;j<=N-1){
            if (A[j] < A[minj]){
                minj = j;
            }
        }
        A[minj]=A[i];
        trace (A, N);
    }
}

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

Compiler output:
main.c: In function 'intsertionSort':
main.c:17:23: error: expected ';' before ')' token
   17 |         for(j=i;j<=N-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 intsertionSort(int A[], int N){
    int i,j,minj,count;
    for(i=1;i<=N-1;i++){
        minj = i;
        for(j=i;j<=N-1;j++){
            if (A[j] < A[minj]){
                minj = j;
            }
        }
        A[minj]=A[i];
        count++;
    }
    trace(A[],N);
    printf("%d\n",count);
}

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

}

Compiler output:
main.c: In function 'intsertionSort':
main.c:25:13: error: expected expression before ']' token
   25 |     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 intsertionSort(int A[], int N){
    int i,j,minj,count=0;
    for(i=1;i<=N-1;i++){
        minj = i;
        for(j=i;j<=N-1;j++){
            if (A[j] < A[minj]){
                minj = j;
            }
        }
        A[minj]=A[i];
        count++;
    }
    trace(A[],N);
    printf("%d\n",count);
}

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

}

Compiler output:
main.c: In function 'intsertionSort':
main.c:25:13: error: expected expression before ']' token
   25 |     trace(A[],N);
      |             ^