Language: C

#include <stdio.h>
#define MAX 101

//void bubbleSort(struct Card *,int);
//void selectionSort(struct Card *, int);

struct Card{
	char number;
	char suit;
};

int main(void){
	struct Card c1[MAX],c2[MAX];
	int i,s,n,flag=1;
	
	
	scanf("%c%d",&s,&n);
	for(i=0;i<n;i++){
		scanf("%c%c",&c1[i].suit,&c1[i].number);
		c2[i].suit = c1[i].suit;
		c2[i].number = c1[i].number;
		
	}
	
	bubbleSort(c1,n);
	printf("Stable\n");
	
	selectionSort(c2,n);
	
	for(i=0;i<n;i++){
		if(c1[i].suit!=c2[i],suit){
			printf("Not stable\n");
			flag=0;
			break;
		}
	}
	if(flag==1)printf("stable\n");
	return 0;
}

void bubbleSort(struct Card *C,int n){
    int i,j,a;
    struct Card tmp;
     
    for(i=0;i<n;i++){
        for(j=n-1;j>=i+1;j--){
            if(C[j].number<C[j-1].number){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    for(a=0;a<n;a++){
    printf("%c%d",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)print("\n");
    }
}

void selectionSort(struct Card *C,int n){
  int i,j,a,minj;
  struct Card tmp;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(C[j].number<C[minj].number){
        minj=j;
      }
    }
    tmp = C[i];
    C[i]=C[minj];
    C[minj]=tmp;
  }
  for(a=0;a<n;a++){
    printf("%c%d",C[a],suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:25:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:28:9: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c:31:30: error: invalid operands to binary != (have 'int' and 'struct Card')
   31 |                 if(c1[i].suit!=c2[i],suit){
      |                    ~~~~~~~~~~^~~~~~~
      |                         |        |
      |                         char     struct Card
main.c:31:38: error: 'suit' undeclared (first use in this function)
   31 |                 if(c1[i].suit!=c2[i],suit){
      |                                      ^~~~
main.c:31:38: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:41:6: warning: conflicting types for 'bubbleSort'; have 'void(struct Card *, int)'
   41 | void bubbleSort(struct Card *C,int n){
      |      ^~~~~~~~~~
main.c:25:9: note: previous implicit declaration of 'bubbleSort' with type 'void(struct Card *, int)'
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:57:15: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   57 |     if(a==n-1)print("\n");
      |               ^~~~~
      |               printf
main.c: At top level:
main.c:61:6: warning: conflicting types for 'selectionSort'; have 'void(struct Card *, int)'
   61 | void selectionSort(struct Card *C,int n){
      |      ^~~~~~~~~~~~~
main.c:28:9: note: previous implicit declaration of 'selectionSort' with type 'void(struct Card *, int)'
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c: In function 'selectionSort':
main.c:77:24: error: 'suit' undeclared (first use in this function)
   77 |     printf("%c%d",C[a],suit,C[a].number);
      |                        ^~~~