CI

C++ Certified Professional Programmer

228 Questions

You can start the exam to practice all questions related to this exam.

Question No. 1

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


#include <iostream>
#include <set>
#include <list>
using namespace std;
int main(){
int t[] ={ 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
list<int>v(t, t+10);
set<int> s1(v.begin(),v.end());
if (s1.count(3) == 2) {
s1.erase(3);
}
for(set<int>::iterator i=s1.begin();i!= s1.end(); i++) {
cout<<*i<<" ";
}
return 0;
}
Choose the correct option from the given list.
01 / 228

0 Discussions

Trending Exams