Sorting of given two sorted LinkedList

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

why it is not giving any output.
i want to return the whole LinkedList in sort function how to do that.
correct the code.

Hey Ankur, mistake is in calling the buildList function as you have commented this function and didn’t passed the correct head lists will not build. I have corrected your code, here is the code snippet of main() :

int main() {
    node* head1 = NULL; 
    node* head2 = NULL;
    //node*head3 = NULL;

    buildList(head1);
	buildList(head2);
    print(head1);
    //cin>>head1>>head2;
    //cout<<head<<endl<<head2;

   print(sortll(head1,head2));
    //cout<<head4<<end;    
    return 0;
}

no sir this is giving only the first linked list as output.
but i want the sorted linked list as result.my sortll function is not working well.
so print(sortll(head1,head2)) line in the main is not working well .

i want merged sorted linked list.