I would use a while loop here since the incrementation is done in the loop body.

Also, spacing around "!=".