im doing a for loop that goes like this.... for (i=1 , i<=30000 , i++)
ok but want to printout a result every 1000 of the time.... how to do that.. please..
Printable View
im doing a for loop that goes like this.... for (i=1 , i<=30000 , i++)
ok but want to printout a result every 1000 of the time.... how to do that.. please..
See Assignment, Arithmetic, and Unary Operators (The Java™ Tutorials > Learning the Java Language > Language Basics), mainly the remainder operator. Figure out when the remainder of i by 1000 is zero:
Code :if ( i % 1000 == 0 ){ }