Question 9
Back to Exercise
Which call turns 1.66 into 2.0?
- A floor(1.66)
- B ceil(1.66) Correct
- C (int) 1.66
- D trunc(1.66)
Correct Answer: Option B
ceil() rounds up to the next integer value (2.0). floor(), trunc() and a cast to int all give 1. round(1.66) would also give 2.0.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!