Multiple choice technology programming languages

Which of the following will output -4.0

  1. System.out.println(Math.floor(-4.7));

  2. System.out.println(Math.round(-4.7));

  3. System.out.println(Math.ceil(-4.7));

  4. System.out.println(Math.min(-4.7));

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Math.ceil returns the smallest integer greater than or equal to its argument. For -4.7, ceiling gives -4.0 (since -4 is greater than -4.7). Math.floor would give -5.0, Math.round would give -5 (rounds toward positive infinity for negative numbers), and Math.min requires two arguments.