#include<iostream>
using namespace std;
class node{
	public:
        int data;
        node *next;
        void getdata(void);
        };
node *start_ptr;
void node::getdata()
{
        cout<<"\n Please enter data"<<endl;
        cin>>data;
        next=NULL;
}
void add_node()
{
node *start_ptr=NULL;
node *temp,*temp2;
temp->getdata();
if (start_ptr=NULL)
        start_ptr=temp;
else
temp2=start_ptr;
while(temp2->next!=NULL)
{
        temp2=temp2->next;
}
temp2->next=temp;
temp=start_ptr;
/*do
{
        if(temp==NULL)
        cout<<"\nThis is a empty list";
        else
        {
                cout<<"data:"<<temp->data<<endl;
                temp=temp->next;
        }
}while(temp!=NULL);*/
}

main()
{
int choice;
node *temp;
	do
	{
	add_node();
	cout<<"\nDo you want to enter more data(1/2):";
	cin>>choice;
	}while(choice=!'2');
	temp=start_ptr;
	do
	{
	if(start_ptr->next=NULL)
	cout<<"\nThe list is empty"<<endl;
		else
		{
		cout<<"data:"<<temp->data<<endl;
		temp=temp->next;
		}
	}while(temp->next!=NULL);
	
}
