Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Create an integer vector of size 5 2. Initialize each element in the vector with a random even number 3. Print the value of
1. Create an integer vector of size 5 2. Initialize each element in the vector with a random even number 3. Print the value of each element in the vector, using iterator if you can 4. Add five random odd numbers to the end of the vector one by one 5. Sort the vector in an ascending order, using a proper sorting algorithm in STL 6. Print the value of each element in the vector 7. Optional 1. Create an integer vector with the same size as the vector obtained in step 5, but the value of each element is doubled. 2. Create another "vector of integer vector" 3. Add the vectors created in steps 5 and 7.1 into the newly created empty "vector of vector" in step 7.2 4. Print the value of each element in this newly created "vector of vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started