Possible Duplicate:
How to get the digits of a number without converting it to a string/ char array?
I am stuck doing this task in C++; what I want to do is to figure out the the units digit and the tens digits of any number given by the user.
For example, if the number is 9775, the units digit is obtained as 9775 % 10
,
but I am stuck finding the tens digit.