Use the itoa() function. This will convert the integer to a string.
Then just run a loop to display the digits.
As you display each digit you can add its value to a total which you can display after the string has displayed.
BTW keep in mind that displaying digits this way uses the ASCII value of the digit. You will need to subtract the offset into the ASCII table to get the numeric value of the digit.
Comment