Computer Applications
Give the output of the following:
- Math.pow(36,0.5) + Math.cbrt(125)
- Math.ceil(4.2) + Math.floor(7.9)
Java Math Lib Methods
51 Likes
Answer
- 11.0
- 12.0
Working
Math.pow(36,0.5) gives 6.0 and Math.cbrt(125) gives 5.0. 6.0 + 5.0 = 11.0
Math.ceil(4.2) gives 5.0 and Math.floor(7.9) gives 7.0. 5.0 + 7.0 = 12.0.
Answered By
20 Likes
Related Questions
Write a Java expression for the following:
|x2 + 2xy|Write the Java expression for
A Student executes the given program segment and it results in 1.0, irrespective of the value of n. State the type of the error, write the correct statement:
void solve(int n) { double power=Math.pow(n, 2/3); System.out.println(power); }The output of the following code is:
System.out.println(Math.ceil(6.4) + Math.floor(-1-2));- 3.0
- 4
- 3
- 4.0