Please help me, if you know how to solve this issue because my code doesn't work 
//Code
for(step=n; step>n/2; step/=2){
for(i=step; i<n; i++){
int temp = arr;
for(j=i; j>=step && arr[j-step]>temp; j-=step){
arr[j] = arr[j-step];
}
arr[j] = temp;
}
}
//Code
for(step=n; step>n/2; step/=2){
for(i=step; i<n; i++){
int temp = arr;
for(j=i; j>=step && arr[j-step]>temp; j-=step){
arr[j] = arr[j-step];
}
arr[j] = temp;
}
}