Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!