include<stdio.h>
#include<conio.h>
#include<alloc.h>
struct node
{
int data;
struct node*next;
} *front,*rear,*temp,*t;
void main()
{
int a,ch;
clrscr();
front=NULL;
rear=NULL;
do
{
int choice;
printf("\n enter 1.INSERT ,2.DELETE,3.DISPALY,4.EXIT");
scanf("%d",&ch);
switch(ch)
{
case 1:
{
printf("\n INSERT OPERATION");
printf("enter the data for the node \t");
scanf("%d",&a);
temp=(struct node*)malloc(sizeof (struct node));
temp->data=a;
temp->next=NULL;
if(front==NULL)
{
front=temp;
rear=temp;
}
else
{
rear->temp=next;
rear=temp;
}
}
break;
case 2:
{
printf("\n DELETION OPERATION");
if(rear==front)
{
printf("\n deletion-not possible");
}
else
{
temp=front;
front=front->next;
temp=t;
free(t);
}
break;
case 3:
{
printf("\n DISPLAY OPERATION |N");
temp=front;
while (temp!=NULL)
{
printf("%d\n",temp->data);
temp=temp->next;
}
}
break;
case 4:
{
exit();
}
break;
default:
{
printf("\n enter the right choice");
}
goto choice;
}
}
}
while (ch<=4);
getch();
}
ERRORs line 37: 'temp' is not a member of 'node'
line 37 : undefined symbol 'next'
line 70:functione exit should have a prototype
line 83:undefined label 'choice'
Tags: