1// Shift right from index of 'a' to 'b'
2for(int i = b; i>a; i--) { array[i] = array[i-1]; }
3/* Note: element at 'a' index will remain unchanged */
4
5// Shift left from index of 'b' to 'a'
6for(int i = a; i<b; i++) { array[i] = array[i+1]; }
7/* Note: element at 'b' index will remain unchanged */
8
9
10
11