error in managing linklist

I have used link list in my program to operate on set of values
the operations that i am doing : add , delete from link list
when i am deleting the intermidiate or last value it is not giving any error but when i am deleting the 1 st value then program hangs

can anyone suggest me the reason

It is very difficult to pinpoint the problem without seeing your code, but I think it's getting stuck in an infinite loop... Anything else and it'd crash, not hang. You may be able to narrow it down by using a debugger with breakpoints, or just inserting print statements at critical places in the code.

the glibc comes with some handy macros for linked lists in queue.h. see also 'man queue' for
examples who to use them propperly.

code your linked list program module wise

first code for inserting
test it ... deliberately test insertion alone

and then proceed with next module..
test it

this will give you a point to look into the problem and find out easily...