โ Back to Arrays
Question 178
Rotate an Array Left by One
Rotate an Array Left by One
An int array is given. Rotate it one position left: each element moves down one index and the first wraps to the end. Print the result on one line separated by single spaces.
For { 1, 2, 3, 4, 5 } the program prints '2 3 4 5 1'.Expected Output:
2 3 4 5 1
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.