โ Back to Arrays
Question 318
Rotate Array Left by One
Rotate Array Left by One
The array {1, 2, 3, 4, 5} is given. Rotate it left by one position: every element shifts one slot toward the front and the old first element wraps around to the end. Print the result separated by single spaces:
2 3 4 5 1
There is no trailing space.Expected Output:
2 3 4 5 1
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.