-
What is the output of this program?
#include <iostream>
#include <queue>
using namespace std;
int main ()
{
priority_queue<int> QueueData;
QueueData.push(25);
QueueData.push(75);
QueueData.push(45);
QueueData.push(55);
while (!QueueData.empty())
{
cout << " " << QueueData.top();
QueueData.pop();
}
cout << endl;
return 0;
}
-
- 75 65 55 45 25
- 75 65 55 45
- 75 65 55
- 75 65
- 75
Correct Option: A
In this program, We used priority_queue and with that we are pushing and popping out the elements.