I appreciate you help very much sylphsang. Now I am no longer loosing any node but my output is now:
42
30
20
28
which is still different from my tutors output which is listed above as
30
42
20
28
Can you clear that part a bit. Linked lists can be very confusing.
I really have a doubt whether ur tutor is having a same code. Definitely there is some other code ur tutor is having which is linking the node in different order.if you want that code i will write the same
with the current flow of code its not possible but if the info of ptr->info = 30; and ptr->info = 42; if its interchanged then the ur tutor order will come.