The modulus % returns the remainder of integer division. Say you have an integer 1,234 - what number would you have to divide 1,234 by to get a remainder of 4 (the ones place)? You'd use that number with the modulus operator to get the ones place.
where Q is the quotient and M is the numerator of the remainder. The modulus operator returns M.
Therefore:
X - Q*Y = M
Or, in programming:
X % Y = M
Therefore, to find the ten's place of a number, let Y = 10 and N be the number we are given:
X = N / 10 (Divide by ten first, so the ten's place becomes the one's place)
M = X % 10
M = X - Q*10
Now let N be for example 1234:
X = 1234 / 10 = 123
M = 123 % 10
M = 123 - 12*10 (Q = 12 because integer division has no decimal portion)
M = 123 - 120 = 3