asked 77.3k views
5 votes
What is Math.ceil(3.6)?
A. 3.0
B. 3
C. 4.0
D. 5.0

1 Answer

2 votes

Answer: 4.0 (choice C)

Reason

"ceil" refers to "ceiling". The ceiling function rounds up to the nearest whole number. The value 3.6 naturally rounds to 4 without needing a ceiling function.

Something like 3.1 and 3.01 and 3.001 will all round to 4 when applying the ceiling function. It doesn't matter how close they are to 3; we always round up.

answered
User Gonki
by
7.6k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.