Linked List Intersection Point Segmentation Fault

please debug my code

hello @rohit267
a) in place of small it should be greater
image

b) also handle corner cases i,e one list become empty .
c) In case of no intersection print -1 ,handle this case as well.

not working, try to run my code once

hello, are you getting my point?

hi @rohit267 ,
image
after this while loop ur lp will be 0. so u cannot use it furthur to compare length of the link list.

so store lp in some variable before this while loop so that u can use it furthur…

check ur updated code here -> https://ide.codingblocks.com/s/233140

ok thankyou for the help