Sum of Digits
Medium📝 Description
Calculate sum of all digits in a number
Input Format
Single integer n
Output Format
Sum of digits
Constraints
-10^9 ≤ n ≤ 10^9
🔍 Sample Input
123
✅ Sample Output
6
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run