or a 'brute force' method - use integer division, and divide by multiples of 10 until the result is zero - would be a simple loop to write:

(int)(93938/ (1*10)) = 9394
(int)(93938/ (2*10)) = 940
(int)(93938/ (3*10)) = 94
(int)(93938/ (4*10)) = 9
(int)(93938/ (5*10)) = 0 // answer is 5