Let the roots of the quadratic equation be $a$ and $b$
It is given that the A.M of the roots $=8$ and their G.M.$=5$
We know that the A.M between $a$ and $b=\large\frac{a+b}{2}$ and
G.M.$=\sqrt {ab}$
$\Rightarrow\:\large\frac{a+b}{2}$$=8$ and $\sqrt {ab}=5$
$\Rightarrow\:a+b=16$ and $ab=25$
Since $a$ and $b$ are roots of the quadratic equation,
sum of the roots $=a+b=16$
Product of the roots $=ab=25$
We know that the general quadratic equation is
$x^2-$(Sum of the roots)$x+$(product of the roots)=0.
$i.e.,$ The required quadratic equation is $ x^2-16x+25=0$