ICSE Class 10 Computer Applications Question 22 of 76

Revising Basic Java Concepts — Question 26

Back to all questions
26
Question

Question 14(j)

State the value and type of each expression.

Math.ceil(-2.73)
Answer

The output value is -2.0. The type of expression is double.

Explanation

Math.ceil( ) returns the smallest double value that is greater than or equal to the argument and is equal to a mathematical integer. -2.0 is the smallest mathematical integer greater than -2.73. Hence, output is -2.0 and data type of result is double.