Intersection point two linked lists error

I think there is something wrong with my head node as my code is returning -1 in the output. Can someone rectify the error in the code.
code link : https://ide.codingblocks.com/s/99955

You have not pointed your head1 to the second list i.e your list2 . You have used addLast function in which head is getting changed.But nothing is done to head1.

See now i have made another addlast1 function to add elements in my 2nd linked list and i have taken care of my head1 in that but still the code is showing me -1 as the output can u plzz correct my code
code link : https://ide.codingblocks.com/s/100201

Code link : https://ide.codingblocks.com/s/100730
You were not adding elements to list2 . You were adding elements to list1 only .So list2 was null and returning -1.