System.out.println(Math.round(Math.ceil(-8.8))); will result in:

ICSE Class 10 Computer Applications PYQ · 2025 Improvement · Section A

1(xvi)1 Mark · 2025 · Section A · 2025 Improvement

System.out.println(Math.round(Math.ceil(-8.8))); will result in:

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.

← Previous questionNext question →

Browse the free Computer Applications sample bank