#include<iostream.h>
int counter=0;
void enqueue(int myqueue[], int &rear, int item){
myqueue[rear]=item;
rear++;
counter++;}//ENQUEUE
int dequeue(int myqueue[], int &front){
int item;
item=myqueue[front];
front++;
counter--;
return item;}//DEQUENUE
int isempty(){
if(counter==0)
return 1;
else return
0;}//ISEMPTY
int isfull(const int MAXSIZE){
if(counter==MAXSIZE)
return 1;
else return
0;}//ISFULL
void main(){
const int
MAXSIZE=10;
int
myqueue[MAXSIZE]; int front=0, rear=0, item, option; //
do{
cout<<"SELECT ONE OF THE FOLLOWING OPTIONS: "<<endl;
cout<<"1-ENQUEUE
2-DEQUEUE 3-ISEMPTY 4-ISFULL 5-QUIT: ";
cin>>option;
switch(option){
case 1:
cout<<"ENTER THE NUMBER: ";
cin>>item;
if(!isfull(MAXSIZE))enqueue(myqueue,
rear, item);
else
cout<<"YOU CAN'T ENQUEUE"<<endl;
break;
case 2:
if(!isempty())cout<<"THE NUMBER DEQUEUE IS:
"<<dequeue(myqueue, front)<<endl;
else
cout<<"YOU CAN'T DEQUEUE"<<endl;
break;
case 3:
if(isempty())
cout<<"QUEUE
EMPTY."<<endl;
else
cout<<"QUEUE IS NOT EMPTY."<<endl;
break;
case 4:
if (isfull(MAXSIZE)==1)
cout<<"QUEUE
FULL."<<endl;
else
cout<<"QUEUE IS NOT FULL."<<endl;
break;
case 5:
cout<<"THANK YOU FOR USING OUR MENU!"<<endl;
break;
default:
cout<<"ENTER CORRECT OPTIONS"<<endl;}//SWITCH
}while(option
!=5);
}//MAIN