integer input 3 will shift each number by 3 places (not two). so the output should be like on your original question.
3,4,5,1,2
arr[1,2,3,4,5] // current array
new_arr[] // new array we are going to build
int p; // the new position for each element in array
for(i= 0; i < n; i++){
p =...