New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



linked list


Posted Date:     Total Responses: 0    Posted By: Dhananjoy Chakraborty   Member Level: Gold   Points/Cash: 3   


# include
# include
struct link
{
char info[20];
struct link *next;
};
int i;
int number ;
struct link *start=NULL,*p,*node;
void create()
{
char ch;
i=1;
node=start;
node->next = (struct link* ) malloc(sizeof(struct link));
node = node->next;
/*first location is created and node is now holding the address of the first location. */
printf("\n Enter string for node: %d: ",i);
scanf("%s", node->info);
fflush(stdin);
node->next = NULL;
printf("\n Enter choice--'n' for break: ");
ch = getche();
while(ch != 'n')
{
i=i+1;
node->next = (struct link* ) malloc(sizeof(struct link));
node = node->next;
printf("\n Enter string for node: %d: ",i);
scanf("%s", node->info);
node->next = NULL;
printf("\n Enter choice-- 'n' for break: ");
ch = getche();
}
printf("\n Total nodes = %d\n", i);
}
void dis(struct link *n)
{
node=n->next;
while(node)
{
printf("\n 0x%x ", node);
printf("%s\n",node->info);
node=node->next;
}
}
void del(struct link *n)
{
int num=0;
int number = 1;
int del_node;
node=n->next;
p = n;
printf("\n Input node number you want to delete:");
scanf(" %d", &del_node);
while(node)
{
if(number == del_node)
{
p->next = node->next;
free(node);
num++;
break ;
}
else
{
node = node->next;
p = p->next;
number ++;
}
}
if(num!=0)
{
printf("\n Desired node is deleted.\n");
dis(start);
}
else
printf("Deletion not possible.");
}
void main()
{
clrscr();
create();
dis(start);
del(start);
getch();
}


Project Feedbacks

Author: GLADWINMember Level: GoldRevenue Score: 1 out of 5
A good and very project.This is even useful for college students


Post Feedback
You must Sign In to post a feedback.
Next Project: linked list
Previous Project: Calculator

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.