Trouble using the header

Hi,
Please check the code I wrote.
The results I get are "0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 "
and what I expected is "0 1 2 3 4 5 6 7 8 9 "
Can anybody explain what the results?
Thanks
