#include
#include
#include
using namespace std;
int main()
{
sets;
s.insert(1);
s.insert(5);
s.insert(7);
s.insert(2);
s.insert(12);
s.insert(10);
auto it = s.lower_bound(15);
cout<< *it <<endl;
return 0;
}
in the above snippet, we have to predict the output. Now, as lower_bound() will give back an iterator pointing to value not less than 15. But as there is no value >=15 it will print to the end of the set ans supposedly give out garbage value. But the answer is 6. HOW?