Answer to Question #23768 in C++ for lovish maini

Question #23768
WAF to show the enqueue operation in queue.
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS