Creating Linked List of 2nd Node
Creating Linked List of 2nd Node
#include <stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node* next;
};
void display(struct node*head)
{
struct node*n=malloc(sizeof(struct node));
n=head;
while(n!=NULL)
{
printf("%d",n->data);
n=n->next;
}
}
int main()
{
struct node*head=malloc(sizeof(struct node));
head->data=45;
head->next=NULL;
head->next=ptr;
display(head);
}