Quickpaste.it
Create Paste
Top Pastes
Recent Pastes
Settings
Account
Tele
Created By
Anonymous
Expires never
Raw
Download
0
#include <iostream> 3 #include<vector> 4 using namespace std; 5 int main() { 6 ite code here 6 vector<int> v ={56,78,34,45}; 7 cout<<"initial vector: "<<"\n"; 2 8 9 for(int i:v) 10 cout<<i<<"\n"; 11 v.push_back(100); 12 v.push_back(200); C 13 cout<<"after adding two elements, contents of vector are:\n"; 14 for(int i:v) 15 cout<<i<<"\n"; 16 cout<<"element at index 1: "<<v.at(1)<<"\n"; 17 cout<<"element at index 3: "<<v.at(3)<<"\n"; JS GO 18 v.at(4)=700; 19 cout<<"after updating, the contents of vector:\n"; 20 for(int i:v) 21 cout<<i<<"\n";v.pop_back(); 24 v.pop_back(); JS 25 cout<<"after deleting an element, contents of vector are:\n"; GO 26 for(int 1:v) 27 cout<<i<<"\n"; 28 return 0;