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