for Loops

AP Computer Science A· difficulty 3/5

<code>for (int i = 0; i < n; i++);</code> is

  • A

    Loops once

  • B

    Compile error

  • C

    Infinite

  • D

    An empty loop body (does nothing each iteration)

    check_circle

Explanation

Trailing <code>;</code> ends the loop body. Common in busy-wait or counting tricks.

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

Related questions