/* Cyclic rotation of array elements - Program to cyclically rotate elements in array. Program should accept a choice that in which direction to rotate - left or right. Suppose array A contains elements {1,2,3,4,5} and if choice is right then o/p should be {5,1,2,3,4} and if choice is left then o/p should be {2,3,4,5,1} */ #include #include void main() { int i, n, t, x[50] ; char choice; clrscr() ; printf("Enter the number of elements: ") ; scanf("%d", &n) ; printf("Enter the elements: \n") ; for(i=0 ; i=1 ; i--) x[i]=x[i-1] ; x[0]=t ; } else if(choice=='L'||choice=='l') { /* Rotating elements to left */ t=x[0] ; for(i=0 ; i<=n-2 ; i++) x[i]=x[i+1] ; x[n-1]=t ; } else printf("Wrong choice entered. \n") ; printf("New array is as shown: \n") ; for(i=0 ; i