Maybe I should do it as some sort of string. Because after 5 digits, the 6th digit isn't the last digit on the end
That's because an "int" can only store up to +32767. after that, it wraps around to -32768.
If you used a "long" instead, you could keep going to two billion plus.
Well, a string could be easier
But it wouldn't engender an understanding of the problem.