Not getting correct output

please rectify my code

I have edited your code a little bit… Pls refer to it… Earlier it wasnt producing any output , but now it is showing some output but not complete output… For that you need to change the reverseLL function in your code… The approach you are using in that function is not completely correct…

node *reverse(node *head, int k )
{
node *current=head;
node *prev=NULL;
node *next=NULL;
int count=0;
while(current!=NULL && count<k)
{
next = current->next;
current->next=prev;
prev=current;
current=next;
count++;
}
if(next!=NULL)
{
head->next=reverse(next,k);
}
return prev;
}

Try to change your code and then submit …