[Solved] Program to shift elements in an array (Not getting correct output) [closed]


Well , you can create a new array to put the numbers shifted so you dont get confused with the temps and simplify your code:

int new_array[n];

for(int i=0;i<n;i++){
  new_array[(i+m)%n]=array[i];
}

solved Program to shift elements in an array (Not getting correct output) [closed]