Single Link List Last Code in C Programming Turbo C
#include<stdio.h>
#include<conio.h>
struct linklist
{
int
no;
struct
linklist *next;
};
typedef
struct linklist node;
void main()
{
void
display(node*);
void
create(node*);
void
insertlast(node *);
node*head;
clrscr();
head=(node*)malloc(sizeof(node));
create(head);
insertlast(head);
display(head);
getch();
}
void
create(node* list)
{
printf("Enter
no,-1 for end");
scanf("%d",&list->
no);
if(list->
no==-1)
list->
next=NULL;
else
{
list->next=(node*)
malloc(sizeof(node));
create
(list-> next);
}
}
void
display(node * list)
{
while(list->
next!=NULL)
{
printf("%d",list->no);
list=list->
next;
}
}
void insertlast(node *list)
{
node
*new1;
new1=(node
*)malloc(sizeof(node));
while(list->next!=NULL)
{
list=list->next;
}
list->next=new1;
new1->next=NULL;
printf("Enter
no");
// list->no=100;
scanf("%d",&list->no);
}
Single Link List insert Code in C Programming Turbo C
#include<conio.h>
void main()
{
int
insertlast(node*);
node*head;
head=(node*)malloc(sizeof(node));
creat(head);
display(head);
head=insertlast(head);
display(haed);
geatch();
}
insertlast(node*
list)
{
node*new1;
new1=(node*)malloc(sizeof(node));
while(list->next
!=NULL)
{
list=list->next;
}
list
next=new1;
new1->next=NULL;
list->no=100;
return
list;
}
Yagnik Gorasiya - Pro Converter
Pro Converter Setup Download Mode
Pro Converter Yagnik Gorasiya and Vishal Vaghela
• click the link start the download ,
➠ Pro_Converter x64Bits Processors :: Click Here...
➠ Pro_Converter Pantanium Processors :: Click Here...
• Description ::
Subscribe to:
Posts
(
Atom
)