Cycle detection and removal

How do I convert my code to bool because there is no pre defined function to detect the cycle
void floydCycleRemoval(Node head)
{
Node
slow=head;
Node*fast=head;
do{
slow=slow->next;
fast=fast->next->next;
}
while(slow!=fast);
fast=head;
while(slow->next!=fast->next){
fast=fast->next;
slow=slow->next;
}
slow->next=NULL;
}

hi @dips123deepali_c25f140838182212
refer this -->

hi @dips123deepali_c25f140838182212
i hope its clear now??

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.