You are on page 1of 2

#include<stdio.

h> free(tmp); CHOICE”);


#include<conio.h> } scanf(“%d”,&ch);
struct list } switch(ch)
{ void disp() {
int data;
{ case 1:
struct list *link;
struct list *q; printf(“\n\nENTER THE
}*front=NULL,*rear=NULL; NUMBER”);
if(front==NULL)
void create(int m) scanf(“%d”,&n);
printf(“\n\nQUEUE IS
{ EMPTY”); create(n);
struct list *tmp;
else break;
tmp=(struct list
{ case 2:
*)malloc(sizeof(struct list));

tmp->data=m;
q=front; del();

tmp->link=NULL; while(q!=NULL) break;

if(front==NULL) { case 3:

front=tmp; printf(“%d==>”,q->data); printf(“\n\nQUEUE


ELEMENTS ARE \n\n”);
else q=q->link;
disp();
rear->link=tmp; }
rear=tmp;
break;
}
} case 4:
}
void del() exit(0);
void main()
{ }
{
struct list *tmp; }
int i,n,ch;
if(front==NULL) while(ch!=4);
clrscr();
printf(“\n\nQUEUE IS FULL”); getch();
do
else }
{
{
printf(“\n\nMENU”);
tmp=front;
printf(“\n\n1.INSERT “);
printf(“\n\nDELETED IS ELEMENT
%d”,tmp->data); printf(“\n\n2.DELETE “);
front=front->link; printf(“\n\n3.DISPLAT “);

printf(“\n\n4.EXIT”);

printf(“\n\nENTER UR

You might also like