Just a reminder first, that an unsigned long, or unsigned long long, int data type, can be larger than you might think.
Read the header file "limits.h" to see the range of integers your compiler supports. Don't change any values in there, just read.
You can "peel" off the right most digit of any integer, one at a time, using this algorithm:
Code:
get theNumber
while (theNumber > 0) {
rightMost digit equals theNumber % 10 //10 is the number base
theNumber = theNumber / 10 //removes the rightmost digit
}
Working with a digit, if you want to change it to a char, you can simply add '0' to it. A number 1 is not the same as a char of '1', of course.
There are also special functions that can help change a number into a string and vice versa.
Although char's are a more compact data type for working with digits, I like using int arrays, for what you are looking to do.