1(xvi)
System.out.println(Math.round(Math.ceil(-8.8))); will result in:
- (a)8.0
- (b)-8.0
- (c)-9
- (d)-8
Show SolutionHide Solution↓
-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.