void insertAtmiddle(node*&head ,int d , int l){
if(head==NULL){
insertAtHead(head , 8);}
// node* ptr = head;
while(head->data != l || head->next!= NULL ){
head = head->next;
}
node *n = new node(d);
n->next = head->next;
head = n;
}
sir i have wrote this funtion for insertion in middle but after calling this funtion if i am calling print function then it is not printing anything please tell me what is the error.