My 2 testcases are getting failed ..plz tell the error

Dry run your code on the following test cases and you will get to know about your mistake -
1
0
2
5 10

10
1 2 3 4 5 6 7 8 9 10
3
12 11 10

i have corrected it thanx…but run error is still coming

Run time error is coming maybe because one of your pointers has become NULL and you are still incrementing that pointer. Try to resolve it. Else I will help you.

i have tried and edited but nothing happened …plz help

Ok do one simple thing -
To detect an intersection point, the values should repeat in one of the linked list. So initialise the variables as -
node *temp1 = head1 and node *temp2 = head2
Now just apply brute force approach. For each temp1, check if temp1->data == temp2->data (for each temp2 as well), till temp1 = NULL. If at any point you find a match, display that value. Else there is no intersection point.