Cody

# Problem 20. Summing digits

Solution 1407810

Submitted on 6 Jan 2018 by claus becker
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = 1; b = 2; out = sumDigits(a); assert(isequal(out, b))

e = 2 f = 2 d = [] d = 2 b = int8 2

2   Pass
a = 10; b = 7; out = sumDigits(a); assert(isequal(out, b))

e = 1024 f = 1024 d = [] f = 102.4000 s = 4.0000 d = 4.0000 f = 102 f = 10.2000 s = 2.0000 d = 4.0000 2.0000 f = 10 f = 1 s = 0 d = 4.0000 2.0000 0 f = 1 d = 4.0000 2.0000 0 1.0000 b = int8 7

3   Pass
a = 16; b = 25; out = sumDigits(a); assert(isequal(out, b))

e = 65536 f = 65536 d = [] f = 6.5536e+03 s = 6.0000 d = 6.0000 f = 6553 f = 655.3000 s = 3.0000 d = 6.0000 3.0000 f = 655 f = 65.5000 s = 5 d = 6.0000 3.0000 5.0000 f = 65 f = 6.5000 s = 5 d = 6.0000 3.0000 5.0000 5.0000 f = 6 d = 6.0000 3.0000 5.0000 5.0000 6.0000 b = int8 25

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!