For inserting a node at the beginning y the foll code wont work?
struct node
{
int data;
struct node *-next;
}*head,*run,*ptr;
typedef struct node n;
void create()
{
if(head==NULL)
{
head=n*(malloc(sizeof(n));
}
else
{
ptr=n*(malloc(sizeof(n));
ptr=head;
scanf("%d",&ptr->data);
head=ptr->data;
ptr=ptr->next;
}