1.

What is the output of this program?
#include <iostream>
#include <set>
using namespace std;
int main ()
{
multiset<int> MultisetData;
for (int k = 0; k < 6; k++) MultisetData.insert(k);
multiset :: key_compare compare = MultisetData.key_comp();
int highest = *MultisetData.rbegin();
multiset :: iterator Iter = MultisetData.begin();
do
{
cout << ' ' << *Iter;
} while (compare(*Iter++, highest));
return 0;
}

A. 0 1 2 3 4 5
B. 0 1 2 3 4
C. 0 1 2 3
D. 0 1 2
E. 0 1
Answer» B. 0 1 2 3 4


Discussion

No Comment Found

Related MCQs