This has very little sense. Firstly, it's better to have the call to nextInt out (before) the for. Secondly, the condition is wrong.
But also the body of the for is wrong.