Equivalent Boolean Expressions (De Morgan's Laws)

AP Computer Science A· difficulty 4/5

<code>(a || !a)</code> evaluates to

  • A

    Compile error

  • B

    false (always)

  • C

    depends on a

  • D

    true (always; tautology)

    check_circle

Explanation

Either a or its negation is true; always true.

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

Related questions