Queue Operations Using Arrays
Queue Operations Using Arrays
#include<stdio.h>
#define MAXSIZE 5
void insertque(int);
void deleteque();
void display();
int queue[MAXSIZE], front = -1, rear = -1;
void main()
{
int choice,value;
clrscr();
while(choice!=4)
{
printf("\nEnter your choice: ");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("Enter the value to insert: ");
scanf("%d",&value);
insertque(value);
break;
case 2: deleteque();
break;
case 3: display();
break;
case 4: exit(0);
break;
default: printf("\nInvalid choice");
break;
}
}
}