CPP practice question 22 of 30
What will happen when you attempt to compile and run the following code? #include #include #include using namespace std; int main(){ int t[] ={ 3, 4…
Choose your answer, then check it against the explanation.
What will happen when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
int main(){
int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };
vectorv(t, t+10);
set s1(v.begin(),v.end());
s1.insert(v.begin(),v.end());
pair<set::iterator,set::iterator> range;
range = s1.equal_range(6);
cout<<*range.first<<" "<<*range.second<<endl;
return 0;
}
The output will be:
Question 22 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.
More questions
Other CPP practice questions
- Question 1What happens when you attempt to compile and run the following code? #include #include #i…
- Question 2What happens when you attempt to compile and run the following code? #include #include #i…
- Question 3What happens when you attempt to compile and run the following code? #include #include us…
- Question 4What happens when you attempt to compile and run the following code? #include #include #i…
- Question 5What happens when you attempt to compile and run the following code? #include #include us…
- Question 6What will happen when you attempt to compile and run the code below, assuming that you en…
