Casting and Ranges of Variables

AP Computer Science A· difficulty 3/5

What is the value of <code>7.0 / 2</code>?

  • A

    3.5

    check_circle
  • B

    3

  • C

    Compiler error

  • D

    4

Explanation

A <code>double</code> operand promotes the other to <code>double</code>; 7.0 / 2 = 3.5.

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

Related questions