Cody

Problem 46090. Last Digit of fibonacci number

Solution 2862614

Submitted on 20 Aug 2020 by David Hill
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   Pass
assert(isequal(fib_last_digit(136),7))

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

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

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

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!