It should actually be "<= k" rather than less than.
Use 9 as an example and you'll see. The for loop ends and fails to mod 9 against 3, hence returning a value of 1.
Ukie! Thank you very much!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Offline 55 posts
since Apr 2009