temp->ptr=NULL;
temp=first;
printf("Status of the linked list is\n");
while(temp!=NULL)
{
printf("%d",temp->num);
count++;
temp=temp->ptr;
}
printf("NULL");
printf("NO of nodes in the list =%d\n",count);
getch();
}
/*output of the program*/
Enter the data item
1
Do you want to continue(type 0 or 1)?
1
Enter the data item
2
Do you want to continue(type 0 or 1)?
1
Enter the data item
3
Do you want to continue(type 0 or 1)?
1
Enter the data item
4
Do you want to continue(type 0 or 1)?
0
Status of the linked list is
1234NULLNO of nodes in the list =4