Can you pls check the code,its showing wrong output

@dipeshpandey2001
you have hard coded value of k as 3, change it and take a input for value of k.
and at line 57 of your code ( prev=current->next; ) it should be ( current->next = prev ).

https://ide.codingblocks.com/s/576193 pls check still its showing wrong output

as per problem, order of input is n,k then list elements but you are taking n, list elements then k.

understood what i have to do but not understood what diffrence will it make in previous case and this case?

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.