Language: C

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

struct Tr{
  int id;
  char value[2];
};

int main(){

  int N,i,j,minj,M;
  struct Tr *C, *C2,K;

  scanf("%d",&N);

  C = (struct Tr *)malloc(sizeof(struct Tr) * N);
  C2 = (struct Tr *)malloc(sizeof(struct Tr) * N);

  for(i=0; i<=N-1; i++){
    scanf("%s",&C[i].value);
    C[i].id = i;
    C2[i] = C[i];
  }
  //BubbleSort(C, N)
  for(i=0; i<=N-1; i++){
    for(j=N-1; j>=i+1; j--){
      if(C2[j].value[1] < C2[j-1].value[1]){
        K = C2[j];
        C2[j] = C2[j-1];
        C2[j-1] = K;
      }
    }
  }


  //SelectionSort(C2, N)

  for(i=0; i<=N-1; i++){
    minj = i;
    for(j=i; j<=N-1; j++){
      if (C[j].value[1] < C[minj].value[1])
        minj = j;
    }
  }
    K = C[i];
    C[i] = C[minj];
    C[minj] = K;
  }

  printf("%s",C[0].value);
  for(i=1; i<=N-1; i++){
    printf(" %s",C[i].value);
    if(C[i].value[1] == C[i-1].value[1]){
      if(C[i].id < C[i-1].id)
        M = 0;
      else M = 1;
    }
  }
  if(M == 0) printf("\nSrable\n");
  else if(M == 1) printf("\nNot stable\n");

  printf("%s",C2[0].value);
  for(i=1; i<=N-1; i++){
    printf(" %s",C2[i].value);
    if(C[i].value[1] == C[i-1].value[1]){
      if(C2[i].id < C2[i-1].id)
        M = 0;
      else M = 1;
    }
  }
  if(M == 0) printf("\nSrable\n");
  else if(M == 1) printf("\nNot stable\n");
  return 0;
}


Compiler output:
main.c:50:10: error: expected declaration specifiers or '...' before string constant
   50 |   printf("%s",C[0].value);
      |          ^~~~
main.c:50:15: error: unknown type name 'C'
   50 |   printf("%s",C[0].value);
      |               ^
main.c:51:3: error: expected identifier or '(' before 'for'
   51 |   for(i=1; i<=N-1; i++){
      |   ^~~
main.c:51:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   51 |   for(i=1; i<=N-1; i++){
      |             ^~
main.c:51:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   51 |   for(i=1; i<=N-1; i++){
      |                     ^~
main.c:59:3: error: expected identifier or '(' before 'if'
   59 |   if(M == 0) printf("\nSrable\n");
      |   ^~
main.c:60:3: error: expected identifier or '(' before 'else'
   60 |   else if(M == 1) printf("\nNot stable\n");
      |   ^~~~
main.c:62:10: error: expected declaration specifiers or '...' before string constant
   62 |   printf("%s",C2[0].value);
      |          ^~~~
main.c:62:15: error: unknown type name 'C2'
   62 |   printf("%s",C2[0].value);
      |               ^~
main.c:63:3: error: expected identifier or '(' before 'for'
   63 |   for(i=1; i<=N-1; i++){
      |   ^~~
main.c:63:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   63 |   for(i=1; i<=N-1; i++){
      |             ^~
main.c:63:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   63 |   for(i=1; i<=N-1; i++){
      |                     ^~
main.c:71:3: error: expected identifier or '(' before 'if'
   71 |   if(M == 0) printf("\nSrable\n");
      |   ^~
main.c:72:3: error: expected identifier or '(' before 'else'
   72 |   else if(M == 1) printf("\nNot stable\n");
      |   ^~~~
main.c:73:3: error: expected identifier or '(' before 'return'
   73 |   return 0;
      |   ^~~~~~
main.c:74:1: error: expected identifier or '(' before '}' token
   74 | }
      | ^