asked 15.8k views
5 votes
Which error type does the "off-by-one" error belong to?

A. syntax error
B. compile-time error
C. run-time error
D. infinite loop

asked
User Icecrime
by
8.4k points

1 Answer

5 votes

Answer:

The answer is C. run-time error.

Step-by-step explanation:

The "off-by-one" error is a type of run-time error that occurs when a loop or an array index is either incremented or decremented by one more or one less than intended. This error can lead to unexpected program behavior, such as accessing memory that is out of bounds or skipping over elements in an array.

answered
User UneXp
by
7.2k points