Merge sorted linked list

https://ide.codingblocks.com/s/317508 why is this code showing wrong output