Answer to Question #23768 in C++ for lovish maini
WAF to show the enqueue operation in queue.
1
2013-02-06T07:36:28-0500
#include <queue>
#include <conio.h>
#include <iostream>
using namespace std;
void main()
{
queue<int> q;
/* Add elements to the queue (enqueue) */
q.push(6);
q.push(10);
q.push(4);
q.push(17);
q.push(9);
/* Dequeue all elements displaying them on a screen */
while (!q.empty())
{
cout << "& " << q.front();
q.pop();
}
_getch();
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment