Not getting output

i am getting segmentation fault for value having 2 children, please find error in my code

@shivamgoel150, at line 88 , it should be
while(replace->left!=NULL) instead of while(root->left!=NULL)