-----------
Linked List
-----------
#include<iostream.h>
#include<conio.h>
#include<malloc.h>
struct node
{
char str[20];
struct node *next;
};
struct node *nod,*first,*last;
void main()
{
int a,n;
clrscr();
nod=first=last=(struct node*)NULL;
cout<<"Enter the number"<<endl;
cin>>n;
nod=(struct node*) malloc(sizeof(struct node));
first = nod;
for(int i=0;i<n;i++)
{
cin>>nod->str;
last->next = nod;
last = nod;
nod=(struct node*) malloc(sizeof(struct node));
}
nod=first;
for(i=0;i<n;i++)
{
cout<<nod->str<<endl;
nod=nod->next;
}
getch();
}