← Back to STL Containers
Question 530
front and back
front and back
Anarray<int, 3>namedahas been created with the values {3, 5, 9}. Print two lines: the wordFirst:, a space and the first element, then the wordLast:, a space and the last element. Usefront()andback()rather thana[0]anda[2].
Expected Output:
First: 3 Last: 9
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
STL Containersstd::array
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.