Computer Applications
What value will Math.sqrt(Math.ceil(15.3)) return?
- 16.0
- 16
- 4.0
- 5.0
Java Math Lib Methods
ICSE 2023
33 Likes
Answer
4.0
Reason — Math.ceil method returns the smallest double value that is greater than or equal to the argument and Math.sqrt method returns the square root of its argument as a double value. Thus the given expression is evaluated as follows:
Math.sqrt(Math.ceil (15.3))
= Math.sqrt(16.0)
= 4.0
Answered By
14 Likes
Related Questions
The Scanner class method used to accept words with space:
- next()
- nextLine()
- Next()
- nextString()
The keyword used to call package in the program:
- extends
- export
- import
- package
The absence of which statement leads to fall through situation in switch case statement?
- continue
- break
- return
- System.exit(0)
State the type of loop in the given program segment:
for (int i = 5; i != 0; i -= 2) System.out.println(i);- finite
- infinite
- null
- fixed