I can't see anything wrong, unless you're entering negative values.



123%10 = 3

123/10 = 12;

12%10 = 2;