Cody

Problem 46090. Last Digit of fibonacci number

Solution 2968630

Submitted on 19 Sep 2020
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
assert(isequal(fib_last_digit(1),1))

2   Pass
assert(isequal(fib_last_digit(10),5))

3   Pass
assert(isequal(fib_last_digit(51),4))

4   Fail
assert(isequal(fib_last_digit(136),7))

Assertion failed.

5   Fail
assert(isequal(fib_last_digit(1122),6))

Assertion failed.

6   Fail
assert(isequal(fib_last_digit(234567),8))

Assertion failed.

7   Fail
assert(isequal(fib_last_digit(900999),6))

Assertion failed.

8   Pass
assert(isequal(fib_last_digit(0),0))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!