I just read an book about programming, I found a operator that I do not understand like
for(x = 0, y = 4, z = 4000; z; z /= 10)
z /= 10;
is the same as
z = z / 10;
The condition in your for loop is not
z /= 10. The condition is
z != 0) so the loop continues until
z becomes zero.
z is an integer, you'll get this:
1st loop: z = 4000 2nd loop: z = 400 3rd loop: z = 40 4th loop: z = 4
Then there wont be more loops as
z will become zero (as 4/10 is zero for integer division) and the loop will stop.