Description Instructions Declare a vector variable with elements of type int. Name your vector vi (for vector of ints).
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →Description
Instructions
Declare a vector variable with elements of type int. Name your vector vi (for vector of ints).
Generate a random number between 5 and 25 and store it in int variable random_num.
Write a loop that will iterate random_num times.
In each loop iteration (each time through the loop), add a random integer value to vector variable vi with push_back).
Write a range-based for loop to display each element in vector vi.
Display each element on its own line, or all on the same line with a space between elements.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds