What wrong in this code

cout<data<<“check”<<endl;

@Mihir163 you are making many elements point to same head, also in insert at tail function

n->next==NULL;

this line is wrong.
You are not handling the case when k>n, to handle all case, first make k=k%n, now perform operations
If this resolves your doubt mark it as resolved.

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.