CPP practice question 21 of 30

What happens when you attempt to compile and run the following code? #include #include #include using namespace std; int main () { int t[] =…

Choose your answer, then check it against the explanation.

What happens when you attempt to compile and run the following code? #include #include #include using namespace std; int main () { int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5}; vector v (t,t+15); int number = count(v.begin(), v.end(), 2); cout<< number<<endl; return 0; } Program outputs:
Answer options
Question 21 of 30

Keep practicing

Take the free CPP practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CPP practice questions

Scroll to Top