September 27, 2009
Sum of Digits of a number is taken out in two steps. One, using the modulus operator (%) and taking remainder by dividing by 10 to get individual digits and then diving the number itself by 10 to reduce the least significant. It is similar to reversing digits of the number.
September 27, 2009
Reverse of Digits of a number is taken out in two steps. One, using the modulus operator (%) and taking remainder by dividing by 10 to get individual digits and then diving the number itself by 10 to reduce the least significant. It is similar to taking sum of digits.