nodeslow=head;
nodefast=head->next;
while(fast!=NULL&&fast->next!=NULL){
//code
}
//In this why are we writing fast!=NULL,in which case it will give a false value
nodeslow=head;
nodefast=head->next;
while(fast!=NULL&&fast->next!=NULL){
//code
}
//In this why are we writing fast!=NULL,in which case it will give a false value