-
What is the output of this program?
#include <iostream>
#include <set>
using namespace std;
int main ()
{
set<int> SetData;
SetData.insert(25);
SetData.insert(15);
SetData.insert(45);
SetData.insert(35);
SetData.insert(55);
while (!SetData.empty())
{
cout << ' ' << *SetData.begin();
SetData.erase(SetData.begin());
}
return 0;
}
-
- 15
- 15 25
- 15 25 35
- 15 25 35 45
- 15 25 35 45 55
Correct Option: E
In this program, We used the set template and then we are initializing the values and then we are erasing it.