Page 1 of 1

What happens when you attempt to compile and run the following code?#include <iostream>#include <set>#include <vector>us

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 <set>#include <vector>using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector<int>v(t, t+10);multiset<int> s1(v.begin(),v.end());s1.insert(v.begin(),v.end());pair<multiset<int>::iterator,multiset<int>::iterator> range; range = s1.equal_range(6); while (range.first != range.second) { cout<<*range.first<<" "; range.first++;}return 0;}

A. program outputs: 6 6
B. program outputs: 5 7
C. program outputs: 5 5 6 6 7 7
D. program outputs: 5 5 7 7 E. program outputs: 1 1 6 6 5 5