Write A C Function Double Replace If Greater Double P Double X That Replaces T

write a C++ function double replace _if_ greater (double *P, double X) that replaces the value to which P points with X  If X is greater, return the old value to which p pointed.