2(i)
Write Java expression for:
$\frac{|𝑎 + 𝑏|}{\sqrt{a^2 + b^2}}$
Show SolutionHide Solution↓
The Java expression for the given mathematical expression can be written as:
double result = Math.abs(a + b) / Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));