Language: C

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

Compiler output:
main.c: In function 'selectionSort':
main.c:1:6: error: type of 'A' defaults to 'int' [-Wimplicit-int]
    1 | void selectionSort(A, N){
      |      ^~~~~~~~~~~~~
main.c:1:6: error: type of 'N' defaults to 'int' [-Wimplicit-int]
main.c:5:20: error: 'n' undeclared (first use in this function)
    5 |     for(j = i; j < n; j++){
      |                    ^
main.c:5:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:11: error: subscripted value is neither array nor pointer nor vector
    6 |       if(A[j] < A[minj]){
      |           ^
main.c:6:18: error: subscripted value is neither array nor pointer nor vector
    6 |       if(A[j] < A[minj]){
      |                  ^
main.c:11:12: error: subscripted value is neither array nor pointer nor vector
   11 |       t = A[i];
      |            ^
main.c:12:8: error: subscripted value is neither array nor pointer nor vector
   12 |       A[i] = A[minj];
      |        ^
main.c:12:15: error: subscripted value is neither array nor pointer nor vector
   12 |       A[i] = A[minj];
      |               ^
main.c:13:8: error: subscripted value is neither array nor pointer nor vector
   13 |       A[minj] = t;
      |        ^
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("%d ",A[i]);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | void selectionSort(A, N){
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |     printf("%d ",A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:19: error: subscripted value is neither array nor pointer nor vector
   18 |     printf("%d ",A[i]);
      |                   ^
main.c:20:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |   printf("\n%d\n", c);
      |   ^~~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'