Cody

Problem 44067. The last non-zero digit of a factorial

Solution 3435593

Submitted on 27 Oct 2020 at 12:01 by Paul Morant
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
n = 4; d_correct = 4; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

2   Pass
n = 5; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

3   Pass
n = 6; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

4   Pass
n = 7; d_correct = 4; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

5   Pass
n = 8; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

6   Pass
n = 9; d_correct = 8; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

7   Pass
n = 10; d_correct = 8; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

ans = 1

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!