#include <stdio.
h>
# define SIZE 100
int inp_arr[SIZE];
int Rear = - 1;
int Front = - 1;
void main()
{
int ch,insert_item;
while (1)
{
printf("\[Link] Operation\n");
printf("[Link] Operation\n");
printf("[Link] the Queue\n");
printf("[Link]\n");
printf("Enter your choice of operations : ");
scanf("%d", &ch);
switch (ch)
{
case 1:
if (Rear == SIZE - 1)
printf("Overflow \n");
else
{
if (Front == - 1)
Front = 0;
printf("Element to be inserted in the Queue : ");
scanf("%d", &insert_item);
Rear = Rear + 1;
inp_arr[Rear] = insert_item;
}
break;
case 2:
if (Front == - 1 || Front > Rear)
{
printf("Underflow \n");
return ;
}
else
{
printf("Element deleted from the Queue: %d\n", inp_arr[Front]);
Front = Front + 1;
}
break;
case 3:
if (Front == - 1)
printf("Empty Queue \n");
else
{
printf("Elements in Queue: \n");
for (int i = Front; i <= Rear; i++)
printf("%d ", inp_arr[i]);
printf("\n");
}
break;
case 4:
default:
printf("Incorrect choice \n");
}
}
}