Circular linked list problem

im not getting the expected output<<< plz check the bug, and let me know


plz edit in my code

@Bhavya_Goel
There is mistake in line 44, It should be if(tail->data == data). Check the condition, its “==” not “=”

@Bhavya_Goel
dry run your code for following testcase. It is giving segmentation fault
1 2 1 -1

@Bhavya_Goel
I have made changes in your code. Check it here