CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Vector Size

C++ quiz · Question 3
easyArrays

What is the output of this code?

Code

1#include <iostream>
2#include <vector>
3using namespace std;
4 
5int main() {
6 vector<int> v = {1, 2, 3};
7 v.push_back(4);
8 v.push_back(5);
9 cout << v.size() << endl;
10 return 0;
11}