Create an empty vector v. Then, create a prompt which will continuously ask you for a value to insert into the vector, a
Posted: Thu Jul 14, 2022 2:27 pm
Create an empty vector v. Then, create a prompt which will continuously ask you for a value to insert into the vector, along with the index value. Use the insert function to insert the value at the given index. After every iteration, print the vector. Continue to enter values until someone enters an illegal index value. In that case, end the program. Please enter a value: 7 Please enter an index: 0 7 Please enter a value: 3 Please enter an index: 1 73 Please enter a value: 4 Please enter an index: 1 743 Please enter a value: 9 Please enter an index: 2 7 4 9 3 Please enter a value: 8 Please enter an index: 10 Index value not allowed!