Put the assignment (or the example) in code tags, not quote tags, to make sure it displays properly in the forum. I assume that you want it like dwks showed, but if not then you'll have to post the example again so that the leading spaces aren't removed by the forum software.
Just the example. Otherwise those long lines of text would run off the edge of the screen, if you had a reasonably small monitor.

BTW, "x <= i" might be easier to read than "x < i+1".