#include<conio.h>
#include<stdio.h>
#include<alloc.h>
struct node
{
int data;
struct node*next;
};
struct node*head;
void insert(int x)
{
struct node*temp=(node*)malloc(sizeof(struct node));
temp->data=x;
temp->link=head;
head=temp;
}
void display()
{
struct node*temp=head;
printf("list is:");
while(temp!=NULL)
{
printf("%d",temp->data);
temp=temp->next;
}
printf("\n");
}
void main()
{
head=NULL;
printf("how many numbers?\n");
int n,i,x;
scanf("%d",&x);
display();
}
getch();
}
#include<stdio.h>
#include<alloc.h>
struct node
{
int data;
struct node*next;
};
struct node*head;
void insert(int x)
{
struct node*temp=(node*)malloc(sizeof(struct node));
temp->data=x;
temp->link=head;
head=temp;
}
void display()
{
struct node*temp=head;
printf("list is:");
while(temp!=NULL)
{
printf("%d",temp->data);
temp=temp->next;
}
printf("\n");
}
void main()
{
head=NULL;
printf("how many numbers?\n");
int n,i,x;
scanf("%d",&x);
display();
}
}