// print all but 2 elements of // a vector container using iterator (it) #include #include #include using namespace std; int main() { vector x; // push i^2 for(unsigned i=0;i<6;i++){ x.push_back(pow(i,2)); } // all but the last two elements: iterator for(auto it=x.begin(); it!=x.end() - 2; it++){ cout<<*it<<' ' ; } cout<