You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
#include "alloc.h"

struct node
{ int data;
struct node *link;
};

int main()
{ struct node *p;
struct node *ptr;
p=NULL;
ptr=malloc(sizeof(struct node));

insert(&p,333);
display(p);

}
void insert(struct node **q,int num)
{struct node *temp;
temp= (struct node *)malloc(sizeof(struct node));
temp->data=num;
temp->link= NULL;
*q=temp;

}
void display(struct node *q)
{printf("\n");
while(q!=NULL)
{ printf("%d";q->data);
q=q->link;
}
}