I am not getting correct output please suggest me some changes

@Vipul.kapoor hey K can be greater than n.
So make K=k%n.
If this resolves your doubt mark it as resolved.

no it is not solving my doubt

@Vipul.kapoor Hey Their is one small thing missing in last funct

 node *temp = slow;
	while(slow->next!=NULL)
	{
		slow=slow->next;
	}
	slow->next=head;
    head = temp;

You need to change head also. If this resolves your doubt mark it as resolved, else provide me update code once, in which you have made all changes.

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.

u said k can be greater than n
at which point of my code i have to do k=k%n;

@Vipul.kapoor as soon as you read k.

i am getting run time error above is my new code

@Vipul.kapoor
if(d != 0 ){
last(head,d);
}
image