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;}
A. program outputs: 1 2 3 4 5
B. program outputs: 1 2 4 5
C. program outputs: 1 1 2 2 3 4 4 5 5
D. program outputs: 1 1 2 3 3 4 4 5 5 E. compilation error
What happens when you attempt to compile and run the following code?#include <iostream>#include <set>#include <list>usin
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when you attempt to compile and run the following code?#include <iostream>#include <set>#include <list>usin
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!