#include<stdio.
h>
#include<stdlib.h>
struct Node
int data;
struct Node *link;
};
struct Node *Front=NULL, *Rear=NULL;
void display()
struct Node *temp;
temp=Front;
if(temp==NULL) printf("\nQueue is Empty...");
else
while(temp!=NULL)
printf("%d->",temp->data);
temp=temp->link;
printf("NULL");
void Enqueue()
struct Node *temp,*New;
temp=Rear;
New=(struct Node *)malloc(sizeof(struct Node));
printf("\nEnter Data:");
scanf("%d",&New->data);
New->link=NULL;
if(Rear==NULL)
Rear=New;
Front=New;
else
Rear->link=New;
Rear=New;
display(Front);
void Dequeue()
struct Node *temp;
temp=Front;
if(temp==NULL)
printf("\nQueue is Empty....");
else
Front=Front->link;
free(temp);
display(Front);
}
int main()
int ch;
do
printf("\n*");
printf("\nQueue Using Linked List");
printf("\n*");
printf("\n1. Enqueue");
printf("\n2. Dequeue");
printf("\n3. Display");
printf("\n0. Exit");
printf("\nEnter Ur Choice : ");
scanf("%d",&ch);
switch(ch)
case 1:
Enqueue();
break;
case 2:
Dequeue();
break;
case 3:
display();
break;
case 0:
exit(0);
default:
printf("\nInvalid Option...");
break;
}while(ch!=0);