:gem: A curated list of awesome Competitive Programming, Algorithm and Data Structure resources
Creative Commons Attribution 4.0 International
12.36k
stars
2.56k
forks
source link
Create Create a Linked List #107
Closed
KRITGYA2001 closed 3 years ago
include
include
struct node { int data; struct node next; }start,save,ptr;
int main() { start=NULL; char ch='y';
while(ch=='Y' || ch=='y') { ptr = (struct node *)malloc(sizeof(struct node)); printf(" Input the value in the nodes : "); scanf(" %d", &ptr->data); ptr->next=NULL; if(start==NULL) { start=ptr; } else { save=start; start=ptr; ptr->next=save; }
}