Linked List Program Example
Linked List Program Example
h>
#include<stdlib.h>
#include<string.h>
//------------------------------------------------struct node
{
int data;
struct node *next;
}*start=NULL;
//------------------------------------------------------------
void create()
{
char ch;
do
{
struct node *new_node,*current;
if(start==NULL)
{
start=new_node;
current=new_node;
}
else
{
current->next=new_node;
current=new_node;
void display()
{
struct node *new_node;
printf("The Linked List : n");
new_node=start;
while(new_node!=NULL)
{
printf("%d--->",new_node->data);
new_node=new_node->next;
}
printf("NULL");
}
//---------------------------------------------------void main()
{
create();
display();
}
//----------------------------------------------------