Circular Linked List(output is not correct)

Please share the question

Question link -https://hack.codingblocks.com/contests/c/917/471

please tell me what is wrong in my code

You are not inputting the Linked List correctly. In this question you first need to create the circular linked list. Then break it from the point where it forms the loop. Use the Floyd Cycle detection algo as taught in the course.
After breaking the loop you have to print the resulting linked list.
Say If INPUT IS 1 2 3 4 5 2 3 -1
form a linked list 1->2->3->4>5 then you see that 2 has already been visited , so connect the next pointer of 5 to 2. This way you have created the circular linked list . After that just detect the cycle, remove the cycle, print the new linked list.

sir you can give me a reference code for this

code-https://ide.codingblocks.com/s/117942
what is wrong in this code

sir please make change in code whatever required

Still there are a lot of mistakes…

  1. You are not inputting correctly and forming a circular linked list
  2. You have used unnecessary functions.
  3. You are printing the result before calling the breakcycle function
    Please refer the code which i have shared earlier.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.