What is the output of Math.ceil(5.4)+Math.ceil(4.5)?

ICSE Class 10 Computer Applications PYQ · 2024 Paper · Section A

1(viii)1 Mark · 2024 · Section A · 2024 Paper

What is the output of Math.ceil(5.4)+Math.ceil(4.5)?

Show SolutionHide Solution↓

11.0

Reason — The method Math.ceil(double value) in Java rounds up a decimal number to the next highest integer, regardless of the fractional part.

Breakdown of the Expression:

  1. Math.ceil(5.4):
    5.4 is rounded up to 6.0.

  2. Math.ceil(4.5):
    4.5 is rounded up to 5.0.

Adding the Results:
6.0 + 5.0 = 11.0

← Previous questionNext question →

Browse the free Computer Applications sample bank