Digit Sum - II
You are given a non-negative integer N.
Find and print the sum of all digits present in N.
Example 1:
Input:
N = 2917
Output:
19
Explanation:
The sum of digits of given number 2917 is => 2 +9 +1 +7 => 19.
Example 2:
Input:
N = 100
Output:
1
Explanation:
The sum of digits of given number 100 is => 1 + 0 + 0 => 1.
Now Your Turn!
Pick the correct output for the given inputInput:
N = 917293
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= N <= 109