Question PRG-CPP-0045
MediumWhat is the output of this program?
#include <iostream>
#include <set>
using namespace std;
int main() {
set<int> s = {4, 1, 4, 2, 1};
cout << s.size() << " " << *s.begin() << " " << *s.rbegin();
return 0;
}
- A.
3 1 4
- B.
5 4 1
- C.
Sign up free to see the answer and a step-by-step explanation.