Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

rotateArray

//term for how many time you want array to rotate
void rotateArray(int arr [],int size,int term){
    int i=0;
    while(i<term){
    int temp=arr[0];
    for(int j=1;j<size;j++){
        arr[j-1]=arr[j];
    }
    arr[size-1]=temp;
    i++;
    }
}
 
PREVIOUS NEXT
Tagged: #rotateArray
ADD COMMENT
Topic
Name
6+5 =