Question PRG-CPP-0046
MediumWhat is the output of this program?
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
for (int i = 1; i <= 5; i++) v.push_back(i * i);
v.erase(v.begin() + 1);
v.insert(v.begin(), 0);
cout << v.size() << " " << v[2];
return 0;
}
- A.
6 9
- B.
5 9
- C.
Sign up free to see the answer and a step-by-step explanation.