Made the function for kth node,please check it

the code is build according to prateek sir’s logic
but there is some snonymous problem in this olease help

The function starts from line 108

hello @we_kaash

check this loop

    while(head!=NULL)
    {
        rabbit=rabbit->next;
        turtle=turtle->next;
    }

here u are never updaing head . because of which this loop will run soo many time and eventually raabit or turtle pointer will be null , which will cause segfault

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.