Linked_list taking input


when I am giving input 10 20 30 40 -1
it is giving output
10 10 20 30 40
the code is printing head node 2 times
what mistake I am making

@mohitshendre2609 return statement missing after line 38.
dont forget to hit like and ,mark resolved if cleared :smiley: