CPP practice question 23 of 30

What happens when you attempt to compile and run the following code? #include #include #include using namespace std; bool compare(int a, int b) { return a == b; } int main () { int t[] = {1,2,3,4,5,1,2,3,4,5}; vector v (t,t+10); vector::iterator it = v.begin(); int m1[] = {1, 2, 3}; while ( (it = find_first_of (it, v.end(), m1, m1+3)) != v.end()) { cout

Full set: 228 questions
Answer options
A: program outputs: 0 1 2 5 6 7
B: program outputs: 0 5
C: program outputs: 0 0
D: compilation error
E: program will run forever Correct answer
Correct Answer:
E. program will run forever
Scroll to Top