A nifty little trick for this kind of thing is to use the modulus operator %.
It returns the remainder of the division between its left operand and its right operand.
2 % 2 = 0
3 % 2 = 1
6 % 4 = 2
20000 % 10000 = 0
So in your code you could test for this using:
if ( (i%10000) == 0 )
Hope that helps.
All the best,
Great answer, I was expecting the Modulus to come into play first as it's the most easiest. Great non the less.
Any other takers?
EDIT: Will mark this as solved at 20:30.
Last edited on