Not getting any output for the code

image
instead of the c = NULL take another pointer n =NULL

check the code below

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

I update that part now only last reversed part of the list is printing

@Bhavya_Goel


code correct h reverse walla but then the global pointer that u are using are creating a problem

mere code meh the difference is passing head and pointers
pasted ur exact reverse code
so u need to see the other section this part is fine