Here is my code
int i = 0; while (i < 10) { i++; i = i % 10; }
The above code resets
By using this you can reset the value of i to 0 when reaches the limit 10.
int i = 0; while (i < 10) { i++; if(i==10) { i=0; } }