You could use the modulo operator:
Code:
int x=125 % 10;
int y=(125/10) % 10;
results in x containing 5 and y 2.