Casting and Ranges of Variables

AP Computer Science A· difficulty 4/5

<code>7 / 2.0</code> evaluates to

  • A

    Compile error

  • B

    3

  • C

    3.5

    check_circle
  • D

    3.0

Explanation

<code>7</code> widens to 7.0; 7.0 / 2.0 = 3.5.

Want 10 more like this — adaptive to your weak spots?

Related questions