// Finds the sum of digits in a number. sumDigits[n] := { str = "$n" sum = 0 for c = array[char[str]] sum = sum + c - char["0"] return sum }