Question PRG-CPP-0023
EasyWhat is the output of this program?
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v = {3, 1, 2};
v.push_back(5);
cout << v.size();
return 0;
}
- A.
4
- B.
11
- C.
Show answer and explanation
Answer: A
push_back adds one element to the three already there.