II. Predict the output:
1. System.out.println(Math.sqrt(10.24));
2. System.out.println(Math.rint(-99.4));
3. System.out.println(Math.cbrt(42.875));
4. System.out.println(Math.min(-25.5, -12.5));
5. System.out.println(Math.ceil(-0.95));
6. System.out.println(Math.round(-18.51));
7. System.out.println(Math.max(-77.66, -87.45));
8. System.out.println(Math.floor(-0.88));
9. System.out.println(Math.rint(98.5));
10. System.out.println(Math.ceil(65.5));
Answers
Explanation:
Output:
1) 3.2
2) -99.0
3) 3.5
4) -25.5
5) -0.0
6) -19
7) -77.66
8) -1.0
9) 98.0
10) 66.0
SQRT: This will provide the square root of the given function
rint: Returns double value closer to the given value
cbrt: Returns cube root of the number
min: Returns the least value among the given parameter
ceil: Round off to the higher value
round(): Returns closest long value
max(): Maximum value among the parameter
floor(): Returns double value which is less or equal to the given value
To Know More:
1. https://brainly.in/question/11132631
Which among the following Java built in class methods are not synchronized
2. https://brainly.in/question/9040484
How to write string functions in Java?
Answer:
Give output of the following : [2]
i) System.out.println (Math.floor(-99.4));
ii) System.out.println (Math.ceil(-0.95));