K Append Help needed in debugging,

Could you please tell me that where I am going wrong in appending the linked ?list.https://ide.codingblocks.com/s/199804

I have edited your code… Pls change the approach you are following in your kAppend function… Use the concept of slow and fast pointers, called as running technique as,
node *append(node *head,int k)
{
node *slow = head;
node *fast = fast;
node *oldHead=head;
for(int i=0;i<k && fast->next!=NULL;i++)
{
fast=fast->next;
}
while(fast->next!=NULL && fast!=NULL)
{
fast=fast->next;
slow=slow->next;
}
node *newHead=slow->next;
slow->next=NULL;
fast->next=oldHead;
return newHead;
}

I have replied on chat…Pls refer to it…