Write a program to delete any node from a single list

//delete any node
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct node
{
int info,item;
struct node *link;
};
struct node *prev,*n,*first,*this1;
int main()
{
char ch;
int item;
clrscr();
first=NULL;
printf(“Enter q to quite: “);
while((ch=getche())!=’q’)
{
n=(struct node*)malloc(sizeof(struct node));
printf(“\nEnter info= “);
scanf(“%d”,&n->info);
n->link=NULL;
if(first==NULL)
first=n;
else
{
this1=first;
while(this1->link!=NULL)
this1=this1->link;
this1->link=n;
}
printf(“Enter q to quite: “);
}
this1=first;
printf(“\nTraversing of linklist:”);
while(this1!=NULL)
{
printf(“\n%d”,this1->info);
this1=this1->link;
}

printf(“\nEntrer item to delete: “);
scanf(“%d”,&item);
if(item==first->info)
{
this1=first;
first=first->link;
free(this1);
}
else
{
this1=first;
while(this1!=NULL&&this1->info!=item)
{
prev=this1;
this1=this1->link;
}
if(this1==NULL)
printf(“item not found: “);
else
{
prev->link=this1->link;
free(this1);
}
}

this1=first;
printf(“Traversing After insert node:”);
while(this1!=NULL)
{
printf(“\n%d”,this1->info);
this1=this1->link;
}
getch();
return 0;

}