C++ Institute C++ Certified Professional Programmer CPP Question # 60 Topic 7 Discussion

C++ Institute C++ Certified Professional Programmer CPP Question # 60 Topic 7 Discussion

CPP Exam Topic 7 Question 60 Discussion:
Question #: 60
Topic #: 7

What happens when you attempt to compile and run the following code?

#include

#include <algorithm>

#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 v1(t, t + 15);

set s1(t, t + 15);

pair::iterator, vector::iterator > resultSet = equal(s1.begin(), s1.end(), v1.begin());

cout<<*resultSet.first<<" "<<*resultSet.second<

return 0;

}

Program outputs:


A.

2 4


B.

4 2


C.

0 5


D.

compilation error


Get Premium CPP Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.