Reagrding the midpoint

i am not able to run the opertaion of midpoint . Pls help me with code.

Please share your code

int midpoint()
{
	if(head==NULL || head->next==NULL)
	{
        if(head==NULL)return -1; //added this
		return head->data; //updated this
	}
	NODE *slow=head;
	NODE *fast=head->next;
	
	while(fast!=NULL && fast->next!=NULL)
	{
		fast=fast->next->next;
		slow=slow->next;
	}
	return slow->data; //updated this
}

Hwy @ssmit_joshi
Only updated midpoint function : https://ide.codingblocks.com/s/363496