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

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

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

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

   return 0;
}


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

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




}
 

Compiler output:
main.c:2:9: warning: ISO C99 requires whitespace after the macro name
    2 | #define N=100
      |         ^
main.c: In function 'main':
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:4:13: note: in expansion of macro 'N'
    4 |    int i, A[N];
      |             ^
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:6:16: note: in expansion of macro 'N'
    6 |    for(i=0; i<=N; i++){
      |                ^
main.c:9:4: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
    9 |    selectionSort(A, N);
      |    ^~~~~~~~~~~~~
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:9:21: note: in expansion of macro 'N'
    9 |    selectionSort(A, N);
      |                     ^
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:11:16: note: in expansion of macro 'N'
   11 |     for(i=0; i<N; i++)
      |                ^
main.c:12:3: error: implicit declaration of function 'rintf' [-Wimplicit-function-declaration]
   12 |   rintf("%d", A[i]);
      |   ^~~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'rintf'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | #define N=100
main.c:12:3: warning: incompatible implicit declaration of built-in function 'rintf' [-Wbuiltin-declaration-mismatch]
   12 |   rintf("%d", A[i]);
      |   ^~~~~
main.c:12:3: note: include '<math.h>' or provide a declaration of 'rintf'
main.c:12:9: error: incompatible type for argument 1 of 'rintf'
   12 |   rintf("%d", A[i]);
      |         ^~~~
      |         |
      |         char *
main.c:12:9: note: expected 'float' but argument is of type 'char *'
main.c:12:3: error: too many arguments to function 'rintf'
   12 |   rintf("%d", A[i]);
      |   ^~~~~
main.c: At top level:
main.c:18:22: error: expected ')' before '=' token
   18 | void selectionSort(A, N);
      |                      ^
      |                      )
main.c:19:1: error: expected identifier or '(' before '{' token
   19 | { int i, j, minj, q;
      | ^
Language: C

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

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

   selectionSort(A, N);

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

   return 0;
}


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

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

}
 

Compiler output:
main.c:2:9: warning: ISO C99 requires whitespace after the macro name
    2 | #define N=100
      |         ^
main.c: In function 'main':
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:4:13: note: in expansion of macro 'N'
    4 |    int i, A[N];
      |             ^
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:6:16: note: in expansion of macro 'N'
    6 |    for(i=0; i<=N; i++){
      |                ^
main.c:10:4: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   10 |    selectionSort(A, N);
      |    ^~~~~~~~~~~~~
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:10:21: note: in expansion of macro 'N'
   10 |    selectionSort(A, N);
      |                     ^
main.c:2:10: error: expected expression before '=' token
    2 | #define N=100
      |          ^
main.c:12:16: note: in expansion of macro 'N'
   12 |     for(i=0; i<N; i++)
      |                ^
main.c: At top level:
main.c:19:22: error: expected ')' before '=' token
   19 | void selectionSort(A, N);
      |                      ^
      |                      )
main.c:20:1: error: expected identifier or '(' before '{' token
   20 | { int i, j, minj, q;
      | ^
Language: C

#include<stdio.h>
int main(void)
{
    int n,i,j,minj,a[],s,temp;

    scanf("%d",&n);

    //selectionSort(A,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-1; j++) {
        minj = j;
        temp = a[i];
        a[i] = a[minj];
        a[minj] = temp;
        s++;
      }
    }

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

    putchar("\n");
    printf("%d",s);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: array size missing in 'a'
    4 |     int n,i,j,minj,a[],s,temp;
      |                    ^
main.c:27:13: error: passing argument 1 of 'putchar' makes integer from pointer without a cast [-Wint-conversion]
   27 |     putchar("\n");
      |             ^~~~
      |             |
      |             char *
In file included from main.c:1:
/usr/include/stdio.h:618:25: note: expected 'int' but argument is of type 'char *'
  618 | extern int putchar (int __c);
      |                     ~~~~^~~
Language: C

#include<stdio.h>

int selectionSort(int a[],int n){

	int i,j,minj,temp;
	int switch=0;

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

int main(){

	int a[100],n,i,switch;

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

	switch = selectionSort(a,n);

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

Compiler output:
main.c: In function 'selectionSort':
main.c:6:13: error: expected identifier or '(' before 'switch'
    6 |         int switch=0;
      |             ^~~~~~
main.c:18:31: error: expected '(' before '++' token
   18 |                         switch++;
      |                               ^~
      |                               (
main.c:20:16: error: expected expression before 'switch'
   20 |         return switch;
      |                ^~~~~~
main.c: In function 'main':
main.c:25:24: error: expected identifier or '(' before 'switch'
   25 |         int a[100],n,i,switch;
      |                        ^~~~~~
main.c:31:16: error: expected '(' before '=' token
   31 |         switch = selectionSort(a,n);
      |                ^
      |                (
main.c:38:25: error: expected expression before 'switch'
   38 |         printf("\n%d\n",switch);
      |                         ^~~~~~
Language: C

#include<stdio.h>

int selectionSort(int A[], int N)
{
   int i, j, minj, temp, a;

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

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

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

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

   return 0;
}

   

Compiler output:
main.c: In function 'selectionSort':
main.c:13:16: error: 'mimj' undeclared (first use in this function); did you mean 'minj'?
   13 |       A[i] = A[mimj];
      |                ^~~~
      |                minj
main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:26: error: expected ';' before 'printf'
   29 |       if(i>0) printf(" ")
      |                          ^
      |                          ;
   30 |       printf("%d", A[i]);
      |       ~~~~~~
Language: C

#include<stdio.h>

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

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

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

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

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

   return 0;
}

   

Compiler output:
main.c: In function 'selectionSort':
main.c:13:16: error: 'mimj' undeclared (first use in this function); did you mean 'minj'?
   13 |       A[i] = A[mimj];
      |                ^~~~
      |                minj
main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:26: error: expected ';' before 'printf'
   29 |       if(i>0) printf(" ")
      |                          ^
      |                          ;
   30 |       printf("%d", A[i]);
      |       ~~~~~~
Language: C

#include<stdio.h>
int main (void){
  int A[100];
  int n, a, d, i, j, minj;
  a = 0;
  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[j] < A[minj])
        minj = j;
    }
    d = A[i]
    A[i] = A[minj];
    A[minj] = d;
    if (i != minj)
      a++;
  }
  for (i = 0;i < n;i++){
    if (i > 0)
      printf (" ");
    printf ("%d",A[i]);
  }
  printf ("\n");
  printf ("%d\n", a);
  return 0;
 }

Compiler output:
main.c: In function 'main':
main.c:15:13: error: expected ';' before 'A'
   15 |     d = A[i]
      |             ^
      |             ;
   16 |     A[i] = A[minj];
      |     ~
Language: C

#include<stdio.h>
int main(void)
{
    int n,i,j,minj,a[],s,temp;

    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-1; j++) {
        minj = j;
        temp = a[i];
        a[i] = a[minj];
        a[minj] = temp;
        s++;
      }
    }

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

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

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: array size missing in 'a'
    4 |     int n,i,j,minj,a[],s,temp;
      |                    ^
Language: C

#include<stdio.h>

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

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

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

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

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

   return 0;
}

   

Compiler output:
main.c: In function 'selectionSort':
main.c:13:16: error: 'mimj' undeclared (first use in this function); did you mean 'minj'?
   13 |       A[i] = A[mimj];
      |                ^~~~
      |                minj
main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:26: error: expected ';' before 'printf'
   29 |       if(i>0) printf(" ")
      |                          ^
      |                          ;
   30 |       printf("%d", A[i]);
      |       ~~~~~~
Language: C

#include<stdio.h>

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

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

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

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

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

   return 0;
}

   

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

#include<stdio.h>
int main(void)
{
    int n,i,j,minj,a[],s,temp;

    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-1; j++) {
        minj = j;
      }
        temp = a[i];
        a[i] = a[minj];
        a[minj] = temp;
        s++;
    }

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

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

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: array size missing in 'a'
    4 |     int n,i,j,minj,a[],s,temp;
      |                    ^
Language: C

#include <stdio.h>

int selectionSort(int A, int N) {
     
     int A[100], N, minj, i, j, k, C;
     for (i = 0; i < N; i++){
          minj = i
     }
     for (j = i; j < N; j++){
       if A[j] < A[minj]
         minj = j
     k = A[i];
     A[i] = A[minj];
     A[minj] = k;
     if (i != minj)
     C++
     }

     return C;

}

int main () {

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

     selectionSort(A, N)

     c = C;

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

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

     return 0;

}

Compiler output:
main.c: In function 'selectionSort':
main.c:5:10: error: 'A' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |          ^
main.c:3:23: note: previous definition of 'A' with type 'int'
    3 | int selectionSort(int A, int N) {
      |                   ~~~~^
main.c:5:18: error: 'N' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |                  ^
main.c:3:30: note: previous definition of 'N' with type 'int'
    3 | int selectionSort(int A, int N) {
      |                          ~~~~^
main.c:7:19: error: expected ';' before '}' token
    7 |           minj = i
      |                   ^
      |                   ;
    8 |      }
      |      ~             
main.c:10:11: error: expected '(' before 'A'
   10 |        if A[j] < A[minj]
      |           ^
      |           (
main.c:16:9: error: expected ';' before '}' token
   16 |      C++
      |         ^
      |         ;
   17 |      }
      |      ~   
main.c: In function 'main':
main.c:27:22: error: 'n' undeclared (first use in this function)
   27 |      for (i = 0; i < n; i++){
      |                      ^
main.c:27:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:20: error: passing argument 1 of 'selectionSort' makes integer from pointer without a cast [-Wint-conversion]
   31 |      selectionSort(A, N)
      |                    ^
      |                    |
      |                    int *
main.c:3:23: note: expected 'int' but argument is of type 'int *'
    3 | int selectionSort(int A, int N) {
      |                   ~~~~^
main.c:31:25: error: expected ';' before 'c'
   31 |      selectionSort(A, N)
      |                         ^
      |                         ;
   32 | 
   33 |      c = C;
      |      ~
Language: C

#include<stdio.h>
int main(void)
{
    int n,i,j,minj,a[],s,temp;

    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-1; j++) {
        minj = j;
      }
        temp = a[i];
        a[i] = a[minj];
        a[minj] = temp;
        s++;
    }

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

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

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: array size missing in 'a'
    4 |     int n,i,j,minj,a[],s,temp;
      |                    ^
Language: C

#include <stdio.h>
int main () {
   int i, temp, a, minj, j, k;
   int A[];

   scanf("%d\n", &a);

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

   for (i = 0; i < a; i++) {
     minj = i;
     for (j = i; j < a; j++) {
       if (A[j] < A[minj]) {
         minj = j;
       }
     temp = A[i];
     A[i] = A[minj];
     A[minj] = temp;
     k++;
     }
   }

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

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

   return 0;
}

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

#include <stdio.h>

int selectionSort(int A, int N) {
     
     int A[100], N, minj, i, j, k, C;
     for (i = 0; i < N; i++){
          minj = i;
          for (j = i; j < N; j++){
                 if(A[j] < A[minj]){
                       minj = j;
                 }
          k = A[i];
          A[i] = A[minj];
          A[minj] = k;
          if (i != minj){
               C++;
          }
        }
     }

     return C;

}

int main () {

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

     selectionSort(A, N);

     c = C;

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

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

     return 0;

}

Compiler output:
main.c: In function 'selectionSort':
main.c:5:10: error: 'A' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |          ^
main.c:3:23: note: previous definition of 'A' with type 'int'
    3 | int selectionSort(int A, int N) {
      |                   ~~~~^
main.c:5:18: error: 'N' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |                  ^
main.c:3:30: note: previous definition of 'N' with type 'int'
    3 | int selectionSort(int A, int N) {
      |                          ~~~~^
main.c: In function 'main':
main.c:29:22: error: 'n' undeclared (first use in this function)
   29 |      for (i = 0; i < n; i++){
      |                      ^
main.c:29:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:20: error: passing argument 1 of 'selectionSort' makes integer from pointer without a cast [-Wint-conversion]
   33 |      selectionSort(A, N);
      |                    ^
      |                    |
      |                    int *
main.c:3:23: note: expected 'int' but argument is of type 'int *'
    3 | int selectionSort(int A, int N) {
      |                   ~~~~^
main.c:35:10: error: 'C' undeclared (first use in this function)
   35 |      c = C;
      |          ^
Language: C

#include<stdio.h>
int main(void)
{
    int n,i,j,minj,a[],s,temp;

    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-1; j++) {
        if(a[j] < a[minj]) 
          minj = j;
        }
        temp = a[i];
        a[i] = a[minj];
        a[minj] = temp;
        s++;
    }

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

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

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: array size missing in 'a'
    4 |     int n,i,j,minj,a[],s,temp;
      |                    ^
Language: C

#include <stdio.h>

int main()
{
  int i, j, n, temp, minj=10000, cnt = 0;
  int a[100];

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

  for (i = 0; i < n; i++) {
    minj = i;
    for (j = i + 1; j < n; j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (a[i] > a[minj]) {
      temp = a[i];
      a[i] = a[min]j;
      a[minj] = temp;
      cnt++;
    }
  }

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

  return 0;
}

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

#include <stdio.h>

int selectionSort(int A[100], int N) {
     
     int A[100], N, minj, i, j, k, C;
     for (i = 0; i < N; i++){
          minj = i;
          for (j = i; j < N; j++){
                 if(A[j] < A[minj]){
                       minj = j;
                 }
          k = A[i];
          A[i] = A[minj];
          A[minj] = k;
          if (i != minj){
               C++;
          }
        }
     }

     return C;

}

int main () {

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

     selectionSort(A, N);

     c = C;

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

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

     return 0;

}

Compiler output:
main.c: In function 'selectionSort':
main.c:5:10: error: 'A' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |          ^
main.c:3:23: note: previous definition of 'A' with type 'int *'
    3 | int selectionSort(int A[100], int N) {
      |                   ~~~~^~~~~~
main.c:5:18: error: 'N' redeclared as different kind of symbol
    5 |      int A[100], N, minj, i, j, k, C;
      |                  ^
main.c:3:35: note: previous definition of 'N' with type 'int'
    3 | int selectionSort(int A[100], int N) {
      |                               ~~~~^
main.c: In function 'main':
main.c:29:22: error: 'n' undeclared (first use in this function)
   29 |      for (i = 0; i < n; i++){
      |                      ^
main.c:29:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:10: error: 'C' undeclared (first use in this function)
   35 |      c = C;
      |          ^
Language: C

#include <stdio.h>

int selectionSort(int A[100], int N) {
     
     int minj, i, j, k;
     int C = 0;
     for (i = 0; i < N; i++){
          minj = i;
          for (j = i; j < N; j++){
                 if(A[j] < A[minj]){
                       minj = j;
                       k = A[i];
                       A[i] = A[minj];
                       A[minj] = k;
                       }                            }
                 }
                 if (i != minj){
                            C++;
                            }
          }

     return C;

}

int main () {

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

   C =  selectionSort(A, N);

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

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

     return 0;

}

Compiler output:
main.c:22:6: error: expected identifier or '(' before 'return'
   22 |      return C;
      |      ^~~~~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^
Language: C

#include <stdio.h>

int selectionSort(int A[100], int N) {
     
     int minj, i, j, k;
     int C = 0;
     for (i = 0; i < N; i++){
          minj = i;
          for (j = i; j < N; j++){
                 if(A[j] < A[minj]){
                       minj = j;
                       k = A[i];
                       A[i] = A[minj];
                       A[minj] = k;
                       }                            }
                 }
                 if (i != minj){
                            C++;
                            }
          }

     return C;

}

int main () {

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

   C =  selectionSort(A, N);

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

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

     return 0;

}

Compiler output:
main.c:22:6: error: expected identifier or '(' before 'return'
   22 |      return C;
      |      ^~~~~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^
Language: C

#include <stdio.h>
 
int SelectionSort(int a[100], int n) {
    int i, j, mini, x;
    int c = 0;
    for (i = 0; i < n; i++) {
        mini = i;
        for (j = i; j < n; j++) {
            if (a[j] < a[mini])
                mini = j;
        }
        x = a[i];
        a[i] = a[mini];
        a[mini] = x;
        c += 1;
        }
    }
    return c;
}
 
int main()
{
    int a[100], n, i, c;
 
    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &a[i]);
 
    c = SelectionSort(a, n);
 
    for (i = 0; i < n; i++) {
        if (i == n - 1) {
            printf("%d\n", a[i]);
        } else {
            printf("%d ", a[i]);
        }
    }
    printf("%d\n", c);
 
    return 0;
}

Compiler output:
main.c:18:5: error: expected identifier or '(' before 'return'
   18 |     return c;
      |     ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

#include <stdio.h>

int main(){

int i, j, N, A[100], minj, c, temp;

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

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:23: error: expected expression before ')' token
   16 |  for (j = i; j < N; j+){
      |                       ^
main.c:27:12: error: expected ';' before 'print'
   27 |  printf("")
      |            ^
      |            ;
   28 |  print("%d", &A[i])
      |  ~~~~~      
main.c:30:18: error: expected ';' before 'return'
   30 |  printf("%d", &c)
      |                  ^
      |                  ;
   31 | 
   32 | return 0;
      | ~~~~~~
Language: C

#include <stdio.h>

int main(){

int i, j, N, A[100], minj, c, temp;

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

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:12: error: expected ';' before 'printf'
   27 |  printf("")
      |            ^
      |            ;
   28 |  printf("%d", &A[i])
      |  ~~~~~~     
main.c:30:18: error: expected ';' before 'return'
   30 |  printf("%d", &c)
      |                  ^
      |                  ;
   31 | 
   32 | return 0;
      | ~~~~~~
Language: C

#include <stdio.h>

int main(){

int i, j, N, A[100], minj, c, temp;

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

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:13: error: expected ';' before 'printf'
   27 |  printf(" ")
      |             ^
      |             ;
   28 |  printf("%d", &A[i])
      |  ~~~~~~      
main.c:30:18: error: expected ';' before 'return'
   30 |  printf("%d", &c)
      |                  ^
      |                  ;
   31 | 
   32 | return 0;
      | ~~~~~~
Language: C

#include <stdio.h>

int main()
{

  int i, j, N, A[100], minj, c = 0, temp;

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

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:13: error: expected ';' before 'printf'
   30 |  printf(" ")
      |             ^
      |             ;
   31 |  printf("%d", A[i]);
      |  ~~~~~~
Language: C

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

Compiler output:
main.c:5:2: error: return type defaults to 'int' [-Wimplicit-int]
    5 |  main(){
      |  ^~~~
main.c:14:7: error: conflicting types for 'SelectionSort'; have 'void(int,  int)'
   14 |  void SelectionSort(int a, int b){
      |       ^~~~~~~~~~~~~
main.c:2:6: note: previous declaration of 'SelectionSort' with type 'void(int *, int)'
    2 | void SelectionSort(int *,int);
      |      ^~~~~~~~~~~~~
main.c: In function 'SelectionSort':
main.c:19:11: error: subscripted value is neither array nor pointer nor vector
   19 |       if(a[j] < a[minj]){
      |           ^
main.c:19:18: error: subscripted value is neither array nor pointer nor vector
   19 |       if(a[j] < a[minj]){
      |                  ^
main.c:27:15: error: subscripted value is neither array nor pointer nor vector
   27 |     koukan = a[i];
      |               ^
main.c:28:6: error: subscripted value is neither array nor pointer nor vector
   28 |     a[i] = a[minj];
      |      ^
main.c:28:13: error: subscripted value is neither array nor pointer nor vector
   28 |     a[i] = a[minj];
      |             ^
main.c:29:8: error: subscripted value is neither array nor pointer nor vector
   29 |       a[minj] = koukan;
      |        ^
main.c:33:17: error: subscripted value is neither array nor pointer nor vector
   33 |   printf("%d ",a[i]);
      |                 ^
main.c:35:19: error: subscripted value is neither array nor pointer nor vector
   35 |   printf("%d\n", a[b-1]);
      |                   ^
Language: C

#include <stdio.h>

int main(){
 int n;
 int x[n];
 int i,j,minj;
 int c = 0;

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

 for(i = 0;i <= n-1;i++){
  minj = i;
  for(j = 0;j <= n-1;j++){
   if(x[j] < x[minj]){
    minj = j;
    temp = x[minj];
    x[minj] = x[i];
    x[i] = temp;
    c = c + 1;
   }
  }
 }

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

 return 0;
}

 
  
 

Compiler output:
main.c: In function 'main':
main.c:19:5: error: 'temp' undeclared (first use in this function)
   19 |     temp = x[minj];
      |     ^~~~
main.c:19:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
??
int main(){
??int n,temp;
??int x[n];
??int i,j,minj;
??int c = 0;
??
??scanf("%d\n",&n);
??for(i = 0;i < n;i++){
????scanf("%d ",&x[i]);
??}
??
??for(i = 0;i <= n-1;i++){
????minj = i;
????for(j = 0;j <= n-1;j++){
??????if(x[j] < x[minj]){
????????minj = j;
????????temp = x[minj];
????????x[minj] = x[i];
????????x[i] = temp;
????????c = c + 1;
??????}
????}
??}
??
??for(i = 0;i < n;i++){
????printf("%d ",x[i]);
??}
??printf("\n%d\n",c);
??
??return 0;
}

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

#include<stdio.h>

int main(){

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

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

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

}

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

#include<stdio.h>

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

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

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

}

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

#include<stdio.h>

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

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

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

}

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

#include<stdio.h>
int main(void)
{
  int i,j,n,minj,a[],temp,s;

  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;
        }
    }
    temp = a[i];
    a[i] = a[minj];
    a[minj] = temp;
    s++;
  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: array size missing in 'a'
    4 |   int i,j,n,minj,a[],temp,s;
      |                  ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:38:25: error: 'n' undeclared (first use in this function)
   38 |                if (i == n - 1){
      |                         ^
main.c:38:25: 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,a[],temp,s;

  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;
        }
    }
    temp = a[i];
    a[i] = a[minj];
    a[minj] = temp;
    s++;
  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: array size missing in 'a'
    4 |   int i,j,n,minj,a[],temp,s;
      |                  ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:38:25: error: 'n' undeclared (first use in this function)
   38 |                if (i == n - 1){
      |                         ^
main.c:38:25: 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,a[],temp,s;

  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;
        }
    }
    temp = a[i];
    a[i] = a[minj];
    a[minj] = temp;
    s++;
  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: array size missing in 'a'
    4 |   int i,j,n,minj,a[],temp,s;
      |                  ^
Language: C

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

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

#include <stdio.h>
int trump[101]={};
int n;

int main(void)
{
    scanf("%d",&n);
    int i,j;

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


    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: expected ',' or ';' before 'for'
   15 |     for(i=0;i<n;i++)
      |     ^~~
main.c:15:20: error: expected ';' before ')' token
   15 |     for(i=0;i<n;i++)
      |                    ^
      |                    ;
main.c:15:20: error: expected statement before ')' token
Language: C

#include <stdio.h>

#define MAX 100


void bubbleSort(int *A , int N){
  int i,j;
  int temp;
  int minj;
  int num = 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) num++;
    temp = A[i]
    A[i] = A[minj];
    A[minj] = temp;
  }
  for(i = 0 ; i < N ; i++){
    printf("%d", A[i]);
    if(i != N-1) printf(" ");
  }
  printf("\n");
  printf("%d\n", num);

  return;
}

int main(void){

  int N;
  int A[MAX];
  int i;

  scanf("%d",&N);

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

  bubbleSort(A, N);


  return 0;
}

Compiler output:
main.c: In function 'bubbleSort':
main.c:20:16: error: expected ';' before 'A'
   20 |     temp = A[i]
      |                ^
      |                ;
   21 |     A[i] = A[minj];
      |     ~
Language: C

#include<stdio.h>
int main(void){
	int i,j,N;
	int minj,temp,count,flg;
	scanf("%d",&N);
	int a[N];
	count=0;
	for(i=0;i<N;i++){
		scanf("%d",&a[i]);
	}

	count=0;
	for(i=0;i<N-1;i++){
		minj=i;
		flg=0;
		for(j=i;j<N;j++){
			if(a[j]<a[minj]){
				minj=j;
				flg=1;			
			}
		}
		if(flg==1){
			count++;
			temp=a[i];
			a[i]=a[minj];
			a[minj]=temp;
		}
	}
	for(i=0;i<N-1;i++){
		printf("%d ",a[i]);
	}
	printf("%d\n,"a[N-1]);
	printf("%d\n",count);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:23: error: expected ')' before 'a'
   32 |         printf("%d\n,"a[N-1]);
      |               ~       ^
      |                       )
Language: C

#include <stdio.h>
int main(void) {
	int flag = 1, i, j, minj, n, swap, changes = 0, a[100];
	scanf("%d", &n); /*1 <= n <= 100*/
	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;
		}//A[i] ??¨ A[minj] ?????????
		swap = a[i];
		a[i] = a[minj];
		a[minj] = swap;
		changes++;
	}
	for (j = 0; j < n - 1; j++)
		printf("%d ", a[j]);
	printf("%d\n", a[n - 1]);
	printf("%d\n", changes);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:28: error: expected '(' before 'A'
   10 |                         if A[j] < A[minj];
      |                            ^
      |                            (
main.c:10:28: error: 'A' undeclared (first use in this function)
main.c:10:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(){
 int i,j,n,temp,min,count=0;
 int num[100];
 scanf("%d",&n);
 for(i=0;i<n;i++) scanf("%d",&num[i]);

 for(i=0;i<n;i++){
  min=i;
  for(j=i;j<n;j++){
   if(num[min]>num[j]) min=j;
  }
  if(i!=min){
  temp=num[min];
  num[min]=num[i];
  num[i]=temp;
  count++;
  }
 }
 for(i=0;i<n-1;i++)printf("%d ",num[i]);
 printf("%d\n",a[n-1]);
 printf("%d\n",count);
 return 0;
}

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

#include<stdio.h>
#include<iostream>
using namespace std;
int ss(int A[],int N)
{
    int i,j,t,sw=0,minj;
    for(int i=0;i<N-1;i++)
    {
        minj=i;
        for(int 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=ss(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:2:9: fatal error: iostream: No such file or directory
    2 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.