Cody

Problem 46843. Modulo with 5

Solution 3247283

Submitted on 17 Oct 2020 by kaatil_coder
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 = 0; y_correct = 4; assert(isequal(mod5(x),y_correct))

y = 4

2   Pass
x = 2; y_correct = 0; assert(isequal(mod5(x),y_correct))

y = 0

3   Pass
x = 76; y_correct = 4; assert(isequal(mod5(x),y_correct))

y = 4

4   Pass
x = 82; y_correct = 0; assert(isequal(mod5(x),y_correct))

y = 0

5   Pass
x = 10000000028; y_correct = 4; assert(isequal(mod5(x),y_correct))

y = 4

6   Pass
x = 10^9 + 1; y_correct = 0; assert(isequal(mod5(x),y_correct))

y = 0

Suggested Problems

More from this Author5

Community Treasure Hunt

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

Start Hunting!