Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous Difficulty: Medium

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; }

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following Python code? import turtle t=turtle.Pen() t.color(0,0,1) t.begin_fill() t.circle(15) t.end_fill() Which of the following JavaScript logging framework lets one to toggle the plane? In Java, which exception is thrown when there is a type mismatch due to generics? What will be the output of the following C code? #include <stdio.h> void (*(f)())(int, float); typedef void (*(*x)())(int, float); void foo(int i, float f); int main() { x = f; x(); } void (*(f)())(int, float) { return foo; } void foo(int i, float f) { printf("%d %f\n", i, f); } What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.