DSC Exp 10
DSC Exp 10
WAP to Implement QUEUE using arrays that per- forms following operations a) INSERT b)
DELETE c) DISPLAY
#include <iostream>
#include <queue>
int main() {
queue<int> q;
while (true) {
switch (choice) {
case 1:
q.push(value);
cout << "Inserted " << value << " into the queue.\n";
break;
case 2:
if (!q.empty()) {
q.pop();
} else {
break;
case 3:
if (!q.empty()) {
queue<int> temp = q;
while (!temp.empty()) {
temp.pop();
} else {
break;
case 4:
return 0;
default:
return 0;