Answer
$P=\rho.g.h$
Work Step by Step
We know that the mercury exerts a pressure on the walls of the barometer due to its weight that is
given as
$P=\frac{W}{A}$............ eq(1)
But we also know that $W=mg$
$m=\rho. V.$
and $V=h.A$
$\implies W= \rho.g.h.A$
Putting this value of $W$ in eq(1), we obtain:
$P=\frac{\rho.g.h.A}{A}$
This simplifies to:
$P=\rho.g.h$