Computer Applications
System.out.println(Math.round(Math.ceil(-8.8))); will result in:
- 8.0
- -8.0
- -9
- -8
Java
Java Math Lib Methods
7 Likes
Answer
-8
Reason — First, Math.ceil(-8.8) returns -8.0 because ceil() rounds a number up to the nearest integer (for negative numbers, “up” means closer to zero). Then, Math.round(-8.0) returns the integer -8, as round() converts a floating-point number to the nearest whole number.
Answered By
3 Likes
Related Questions
Identify the static method from the list given below:
- length()
- nextLine()
- substring(int)
- isLetter(char)
Which one of the following will be the output of the below statements?
String a[]={"Rohini", "Rajarshi", "Rajeev", "Rehan", "Rebecca"}; System.out.println(a[2].substring(2));- jeev
- Ra
- Raj
- je
Which one of the following Java statements assign 100 to the last element of a 3 × 3 array?
- x[2][2]=100;
- x[3][3]=100;
- x[2][3]=100;
- x[3][2]=100;
Consider the Two dimensional array S[2][3], of storage devices given below, state the index of the Hard disk.
![Consider the Two dimensional array S[2][3], of storage devices given below, state the index of the Hard disk? ICSE 2025 Computer Applications Solved Question Paper.](https://cdn1.knowledgeboat.com/img/abp10/1/q1-18-icse-computer-board-2025-improvement-1133x731.png)
- S[1][0]
- S[0][1]
- S[1][2]
- S[0][0]