Let the roots be $\alpha$ and $\beta$.
Then: A.M. $= \frac{\alpha + \beta}{2} = 5 \implies \alpha + \beta = 10$. G.M. $= \sqrt{\alpha\beta} = 4 \implies \alpha\beta = 16$.
The quadratic equation is $x^2 - (\alpha + \beta)x + \alpha\beta = 0$, i.e., $x^2 - 10x + 16 = 0$.