Answer:
Use bubble sorting
Here is an example program I made:
for(int i = 0; i < length; i++){
for(int j = 0; j < length; j++){
if(j != length - 1){
if(input[j] > input[j + 1]){
storeVar = input[j];
input[j] = input[j+1]; //storeVar2;
input[j+1] = storeVar;
}
}
}