ICSE Class 10 Computer Applications Question 5 of 14

Mathematical Library Methods — Question 5

Back to all questions
5
Question

Question 5

Write Java expressions for the following:

i. The square root of a + 5b3

Answer

Math.sqrt(a + 5 * Math.pow(b, 3))

ii. The cube root of x3 + y3 + z3

Math.cbrt(x*x*x + y*y*y + z*z*z);

iii. The square root of b2 + 4ac

Math.sqrt(b * b + 4 * a * c)