Digit sum

Read a whole number that is 0 or more and print the sum of its digits. For 1234 print 10, because 1 + 2 + 3 + 4 = 10.

Two operators do most of the work: n % 10 is the last digit of n, and n / 10 is n without its last digit. Repeat while there are digits left.

Tests
Results will be shown here
C++
Console
Press Run to start your program.