for example, [1,2,3,4,5] would become [5,1,2,3,4]
I cannot use an extra array and have to only use traversal by index. I can also use ints to store values, but that does not seem to help.
this is my attempt that does not work:
void shiftonetoright(int arr[], int n){
int *ptr1 = arr;
int s1;
while(n>0)
{
ptr1++;
s1 =*ptr1;
*ptr1 =s1;
n--;
}
}