The first time through your for loop, the value of i is 0. Within that first loop, you start a new loop that says while i % 10 == 0, print the value of i. Since 0 % 10 == 0, your while loop begins, prints i, then evaluates the condition again (i % 10 == 0). Since i is still 0, and 0 % 10 is still equal to 0, the while loop runs again, ad infinitum.
Hope this helps.
It's exactly the same and completely different as this tiny ad: