?
What will be the output of the following C++ code?
What will be the output of the following C++ code?
#include <iostream>
#include <queue>
using namespace std;
int main ()
{
priority_queue<int> mypq;
mypq.push(30);
mypq.push(100);
mypq.push(25);
mypq.push(40);
while (!mypq.empty())
{
cout << " " << mypq.top();
mypq.pop();
}
cout << endl;
return 0;
}
#include <iostream>
#include <queue>
using namespace std;
int main ()
{
priority_queue<int> mypq;
mypq.push(30);
mypq.push(100);
mypq.push(25);
mypq.push(40);
while (!mypq.empty())
{
cout << " " << mypq.top();
mypq.pop();
}
cout << endl;
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login