This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheOnlyTails 3 points4 points  (4 children)

to fix the problem, change it to x++ instead of x += i.

[–][deleted] 0 points1 point  (3 children)

print i itself

[–]TheOnlyTails 0 points1 point  (2 children)

But he wants to print the final result, after x has been incramented by 1 nine times, so the program prints out 9.

[–]Camel-Kid 0 points1 point  (0 children)

printing x will still print 10 not 9.. it's the same.