Sign in to run tests against edge cases and save your code automatically.
Problem Description
Hard
Sum Digits of a Number
Algorithms
Iteration & Loops
Arithmetic
Write a program that takes a positive integer and outputs the sum of its individual digits. For example, if the input is 123, the output should be 6 (1+2+3).
Example Input
123
Example Output
6
Success Rate:
0% (0 passed / 0 attempted)
Code
Draft auto-saved
Test Results
Click "Test Code" to evaluate your code against the tests.