Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. void rotateByOne(int arr[])
  2. {
  3. int i, first;
  4.  
  5. /* Store first element of array */
  6. first = arr[0];
  7.  
  8. for(i=0; i<SIZE-1; i++)
  9. {
  10. /* Move each array element to its left */
  11. arr[i] = arr[i + 1];
  12. }
  13.  
  14. /* Copies the first element of array to last */
  15. arr[SIZE-1] = first;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement