Write a program to cyclically rotate an array by one