Page 1 of 1

What happens when you attempt to compile and run the following code?#include <iostream>#include <algorithm>#include <vec

Posted: Wed Aug 03, 2022 9:20 am
by answerhappygod
What happens when you attempt to compile and run the following code?#include <iostream>#include <algorithm>#include <vector>using namespace std;int main () {int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};vector<int> v (t,t+15);vector<int>::iterator it = search_n(v.begin(), v.end(), 4, 2); cout<< it?v.begin()<<endl; return 0;}Program outputs:

A. 10
B. 3
C. 1
D. 15 E. compilation error