Computer Applications
The output of the statement Math.ceil.(89.9) + Math.floor(90.5) is:
- 0.0
- 180
- 180.0
- 180.4
Java Math Lib Methods
1 Like
Answer
180.0
Reason
Math.ceil(89.9)returns the smallest integer greater than or equal to 89.9, which is 90.0.Math.floor(90.5)returns the largest integer less than or equal to 90.5, which is 90.0.- Adding them: 90.0 + 90.0 = 180.0
So, the output is 180.0.
Answered By
2 Likes
Related Questions
Assertion: An array can store elements of different data types.
Reason: An array is a user-defined data type with multiple values of the same data type but a different memory index.
- Assertion is true, Reason is false.
- Both assertion and Reason are false.
- Both assertion and Reason are true.
- Assertion is false, Reason is true.
Which of the following statement is an example for explicit typecasting?
- int amount = 45;
- int amount = 24*24;;
- int amount = Integer.parseInt("45")
- int amount = (int)45.75;
The output of the statement of
"TIGER".indexOf('G')is:- 3
- 2
- -1
- 0
Choose the statement which is equivalent to the given:
if(a>b) System.out.println("Honest"); else System.out.println("Sincere");a>b? System.out.println("Honest"):System.out.println("Sincere");System.out.println(a>b? "Honest":"Sincere");a>b? "Honest": "Sincere";a>b: "Honest"? "Sincere";