Edit: You also realise (I hope), that you are setting i to zero in the first part of that, and incrementing i in the last part. In the second, you are saying that the loop should continue to run as long as i is greater than 10, but since you set i to zero in the first part, it exits the loop before ever doing anything. I assume you meant i < 10. I.e. the loop should continue running as long as i is less than ten.