#include <stdio.h>
#include <stdlib.h>
struct node
{
int info;
struct node *next;
};
typedef struct node node;
void main()
{
node *start,*temp;
char k; int item;
start=(node *)malloc(sizeof(node));
printf("enter the item\n");
scanf("%d",&(start->info));
temp=start;
sos: printf("do u want to continue\n1.yes\n2.no\n");
scanf("%d",&k);
switch(k)
{
case 1:
{
(temp->next)=(node *)malloc(sizeof(node));
printf("enter item\n");
scanf("%d",&item);
(temp->next)->info=item;
temp=temp->next;
goto sos;
break;
}
case 2:
{
temp->next==NULL;
printf("thank u so much\n");
printf("after traversal\n");
temp=start;
printf("%d\n",temp);
while(temp!=NULL)
{
printf("%d\n",temp->info);
temp=temp->next;
break;
}
}
}
}