There is alot wrong with this, for starters, max is always set to 0, so you are always comparing against 0, so chances are you number will be bigger than 0, unless its negative.

Secondly, where do...