When the range is exceeded, the int will turn negative and thus breaking out of the loop.