#include <stdio.h>
#include <string.h> 
void swap(int *A,int *B){
    int C = *A;
    *A = *B;
    *B = C;
};

int *sorts(int A[10]){
    static int As[10];
    for (int i = 0; i < 10; i++) {
        As[i] = A[i];
    }
    int C = 0;
    while(C < 9){
        if (As[C] > As[C+1]) {
            swap(&As[C],&As[C+1]);
            C = 0;
        } else {
            C++;
        };
    };
    return As;
};

int main() {
    int D[10] = {3,2,9,9,7,8,15,11,13};
    int k =0;
    while (k < 9){
        printf("%d!",D[k]);
        k++;
    };
    printf("->");
    memcpy(D, sorts(D), sizeof(D));
    k = 0;
    while (k < 10){
        printf("%d!",D[k]);
        k++;
    };
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: