Cody

Solution 2685536

Submitted on 13 Jul 2020 at 3:27 by Samuel Alfaro
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
x = 10; y_correct = 1010; assert(isequal(dec_bin(x),y_correct))

b = 1 b = 2 b = 3 b = 4 c = 3 z = 10 sum = 1000 z = 2 c = 2 c = 1 sum = 1010 z = 0 c = 0 c = -1

2   Pass
x = 2; y_correct = 10; assert(isequal(dec_bin(x),y_correct))

b = 1 b = 2 c = 1 z = 2 sum = 10 z = 0 c = 0 c = -1

3   Pass
x = 15; y_correct = 1111; assert(isequal(dec_bin(x),y_correct))

b = 1 b = 2 b = 3 b = 4 c = 3 z = 15 sum = 1000 z = 7 c = 2 sum = 1100 z = 3 c = 1 sum = 1110 z = 1 c = 0 sum = 1111 z = 0 c = -1