-1

I want j +100 in every iteration.But I don't know whats wrong with it .It is supposed to be okay .

for (int j=0;j<800;j+100){

body .
 }

Error : not a statement

evalwt
  • 105
  • 1
  • 8

1 Answers1

2

You have to use j+=100 `to incremental your index with 100 :

for (int j=0; j<800; j+=100){
   //body
}

Edit

any other methods to express +100

Here is another way:

for (int j = 0; j < 800; ) {
//----------------------^no parameter here
    //body
    j += 100;//this equivalent to j = j + 100;
}
Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140