Page 1 of 1

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
by answerhappygod
Create An Empty Vector V Then Create A Prompt Which Will Continuously Ask You For A Value To Insert Into The Vector A 1
Create An Empty Vector V Then Create A Prompt Which Will Continuously Ask You For A Value To Insert Into The Vector A 1 (66.04 KiB) Viewed 37 times
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!