Given the following list initialization:
int fill[] = {12, 15, 7, 42, 43, 9, 11, 52, 30, 10};list ex2(fill, fill+sizeof(fill)/sizeof(int)); What is output by each of the following code segments?
a. cout << ex2.size() << " " << ex2.front() << " " << ex2.back();b. cout << *ex2.begin() << " " << * (--ex2.end()) << " " << *ex2.rbegin() << " " << * (--ex2. rend()) ;c. ex2. insert (++ex2.begin() , 99); ex2.pop_back() ; cout << *ex2.begin();d. list:: iterator i = ex2.begin(); while (i != ex2.end()) if (*i%2 == 0) i = ex2.erase(i); else i++;for (i = ex2.begin(); i != ex2.end(); i++) cout << *i << endl;e. list ::iterator i; ex2. sort () ; for (i = ++(++ex2.begin()) ; i != ex2.end(); i++) cout << *i << endl;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.