Getting an error while deleting a node in the middle of linked list give an approach make change

Pls verify the below code

@kishoretaru You are deleting the p+1th element and also in your insert function you are inserting at p+1 th position.
To correct your delete middle function.

prev->next=temp->next;
delete temp;

This will delete the pth element.
If this resolves your doubt mark it as resolved.

Can you pls change that in my code i cant able to figure that out


If this resolves your doubt mark it as resolved.