The output for the given test case is coming out be correct in the ide

I tried this problem using simple if-else and iterative loops. It seems to work for the given test case and all the test case which I tried on other IDEs;
Can you please help me with this; Is there any error with the output format?

Code link: https://ide.codingblocks.com/s/100597

You are using a wrong approach in your code, you have to simply pass two nodes to the function and then use
if(a->datadata)
{
c=a;
c->next=merge(a->next,b);
}
else
{
c=b;
c->next=merge(a,b->next);
}