A problem that lets the user enter any positive integer, but you do not have to check for this, and then calculates the sum of the digits and displays this to user. For example, if user enters 14503, the outputted sum of the digits would be 13. You need turn in an algorithm, C++ source code and output.
how do i even go about making 1 add to 4? and so on. I'm lost.
You just need an accumulator variable to store sum of your digits and wrap yor digits extraction into loop. You just did the most crucial thing yourself.
Your algorithm should be something like:
1) create accumulator variable and initialize it to 0
2) get last digit using (% 10) operation and add it to accumulator
3) Discard last digit from number using (/ 10) operation
4) if number isn't equals to 0 repeat from step 2
5) return accumulator