| 2 | using namespace std; |
| 3 | int queue[50], n=50, front=0, rear=-1; |
| 4 | void Insert(){ |
| 5 | int item; |
| 6 | if(rear== n-1) //Condition of Queue Overflow |
| 7 | {cout<<"Queue Overflow"<<endl;} |
| 8 | else{ |
| 9 | cout<<"Enter the item to insert: "<<endl; |
| 10 | cin>>item; |
| 11 | rear++; |
| 12 | queue[rear]=item; |
| 13 | }} |
| 14 | void Delete(){ |
| 15 | if((front==0 && rear==-1) || front==rear+1){ //Condition of Queue underflow |
| 16 | cout<<"Queue Underflow "; |