Please help me find the error in the given code, After returning the new head and using the printing function, no output gets displayed
Node *interChange(Node *head, int n){
Node *tempoo = head;
Node *temp = head;
int tot =0;
while(tempoo != NULL){
tempoo = tempoo->next;
tot++;
}
int count =0;
while(count < tot-n){
temp=temp->next;
count++;
}
Node *newHead = temp->next;
temp->next=NULL;
Node *newTemp = newHead;
while(newTemp != NULL){
newTemp = newTemp->next;
}
newTemp->next = head;
return newHead;
}