head 1.1;
access;
symbols;
locks
root:1.1; strict;
comment @ * @;
1.1
date 2014.03.23.22.24.26; author root; state Exp;
branches;
next ;
desc
@create linklist .
@
1.1
log
@Initial revision
@
text
@#include
#include
#include
struct node
{
int roll;
char name[20];
struct node *next;
};
void creat_node(struct node * temp)
{
struct node *start;
temp->next=malloc(sizeof(struct node));
temp=temp->next;
printf(“\nentrer the roll”);
scanf(“%d”,&temp->roll);
printf(“enter the name \n”);
scanf(“%s”,temp->name);
temp->next=NULL;
}
void display_node(struct node *temp)
{
while(temp!=NULL)
{
printf(“roll is %d\n”,temp->roll);
printf(“name is %s\n”,temp->name);
temp=temp->next;
}
}
int main()
{
int i,n;
struct node *start,*temp;
start=malloc(sizeof(struct node));
temp=start;
printf(“\nentrer the roll”);
scanf(“%d”,&temp->roll);
printf(“enter the name \n”);
scanf(“%s”,temp->name);
printf(“enter the number of no. of node\n”);
scanf(“%d”,&n);
temp->next=NULL;
creat_node(temp);
for(i=0;inext;
}
display_node(start);
{
display_node(start);
}
}
@