while Loops

AP Computer Science A· difficulty 4/5

A sentinel loop

  • A

    Has no condition

  • B

    Continues until special 'sentinel' value is encountered

    check_circle
  • C

    Runs a fixed number of times

  • D

    Throws sentinel exception

Explanation

Reads input until a special terminator (e.g., -1) is seen.

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

Related questions