Here is my code
int i = 0; while (i < 10) { i++; i = i % 10; }
The above code resets
Your first loop iterates over the numbers 0..9. You can make your code iterate over 9..0 in the same way:
int i = 10; while (i > -1) { i--; i = i % 10; }