Multiple choice technology programming languages

True or false: If you continuously increment a variable, it will become negative?

  1. True

  2. False

  3. It depends on the variable type

  4. None of the Above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

For signed integers, continuous increment eventually overflows into negative values (undefined behavior in C++, but typically wraps to negative on most systems). For unsigned integers, overflow wraps to zero. For floating-point types, overflow becomes infinity. So the behavior depends entirely on the variable type.