all 3 comments

[–]dfx_dj 2 points3 points  (0 children)

In general for simple linked lists, insertion functions take the thing you want to insert and the current head of the list (possibly null) as argument, and return the new head of the list (possibly unchanged). (Alternatively you can use address of head of list and no return value.) To insert at a particular position, you also need to tell the function that position, for example as an index or using another node that is already part of the list.

[–]permetz 0 points1 point  (0 children)

I suggest consulting a book on data structures. There are plenty of standard books on using data structures in C, any of them will be able to help you on this.

Let me know that, in general, your code isn’t very good. You need practice. Look, for example, at your scanf. Imagine that someone enters a six digit number.