No output coming

https://ide.codingblocks.com/s/56118

what is wrong in this code??
i am trying to merge two sorted linked lists

Hi Vishesh, dry-run your code for a sample test-case. And you have not taken the number of testcases as an input. You need to take the number of testcases as an input before the for loop.

Hey Vishesh, there are some mistakes in your code

  • You haven’t taken input for t.
  • when you are adding nodes at head3->next you are not traversing till the tail of the linked list head3 to add the new node at the last. Basically, everytime you are updating only the second node of the head3 linked list.

https://ide.codingblocks.com/s/56739
now getting run error on submitting but running properly on codeblocks.
please tell what is going wrong

Hi Vishesh, consider the following cases:
3
1 2 3
0
Expected output: 1 2 3
Your output:
0 0 0 2
0 0 0 0
0 0 0 0

Input:
2
4 4
2
4 4
Expected output: 4 4 4 4
Your output:
4 4 4 4 4 4 4 4 4 2 4 4
4 4 4 4 4 4 4 4 4 4 4 4