adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <queue>
    using namespace std;
    int main ()
    {
        priority_queue<int> mypq;
        mypq.push(10);
        mypq.push(20);
        mypq.push(15);
        cout  << mypq.top() << endl;
        return 0;
    }

a.

15

b.

20

c.

10

d.

Error

Answer: (b).20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?