Question PRG-CPP-0061
HardWhat is the output of this program?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> v = {1, 2, 3, 4, 5, 6};
v.erase(remove_if(v.begin(), v.end(), [](int x) { return x % 2 == 0; }), v.end());
cout << v.size() << " " << v.back();
return 0;
}
- A.
3 5
- B.
6 6
- C.
Sign up free to see the answer and a step-by-step explanation.