Try like this:
#include <stdio.h>
int main(void){
int unsorted[] = {1,3,4,5,2};
int i = 0;
int j = 0;
int temp = 0;
for(i = 1; i < 5; i++){
j = i;
while(j>0 && unsorted[j]<unsorted[j-1]){
temp = unsorted[j];
unsorted[j] = unsorted[j-1];
unsorted[j-1] = temp;
j--;
}
}
for(i = 0; i < 5; i++){
printf("%d", unsorted[i]);
}
return 0;
}