Merge two sorted linked list

sir, why you return c at the end of the function.
is it necessary?

In this question we are merging two sorted linkedlists into a new linkedlist. ‘a’ is the head of one linkedlist and ‘b’ is the head of another linkedlist. And we are merging these 2 linkedlists into a new linkedlist who head is ‘c’. So, it is absolutely necessary to return ‘c’, else we wont be having the pointer to the head of the newly created linkedlist.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

https://ide.codingblocks.com/s/409936
this is my code for merging sorted linked list.Up on submission I am facing RUN ERROR.But when giving custom input the output is as expected.can someone please help?