ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
#include <set>
using namespace std;
int main ()
{
    multiset<int> mymultiset;
    for (int i = 0; i < 5; i++) mymultiset.insert(i);
    multiset<int> :: key_compare mycomp = mymultiset.key_comp();
    int highest = *mymultiset.rbegin();
    multiset<int> :: iterator it = mymultiset.begin();
    do 
    {
        cout << ' ' << *it;
    } while (mycomp(*it++, highest));
    return 0;
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.