if-else Statements

AP Computer Science A· difficulty 2/5

What does this print when x = 5?

<code>if (x > 10) System.out.println("big"); else System.out.println("small"); </code></pre>

  • A

    Nothing

  • B

    big small

  • C

    small

    check_circle
  • D

    big

Explanation

5 is not > 10, so else branch runs.

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

Related questions