You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
struct list
{
int data;
struct linked * next;
}start, t1;
void main()
{
clrscr();
int count=0;
char ch;
ch='y';
do
{
temp = new list;
cout<<"\nEnter the " << count+1<<"th element of the linkes list ";
cin>>temp.data;
temp->next=NULL;
if (count == 0)
{
start=temp;
}
else
{
t1=start;
while(t1!=NULL)
{
t1=t1->next;
}
t1=temp;
}
cout<<"\ndo you wnat to enter more elements into the list? ";
cin>>ch;
}while(ch=='y'||ch=='Y');//end of while
cout<<"\n\nThe Linked list entered is ";
t1=start;
while (t1!=NULL)
{
cout<<"\t"<<t1->data<<"\t";
}
getch();
}