Cody

Problem 45251. Last non-zero digit

Solution 2157004

Submitted on 11 Mar 2020 by HH
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 = 66; y_correct = 6; assert(isequal(last_Factorial(n),y_correct))

ans = 6

2   Pass
n = 52; y_correct = 4; assert(isequal(last_Factorial(n),y_correct))

ans = 4

3   Pass
n = 9; y_correct = 8; assert(isequal(last_Factorial(n),y_correct))

ans = 8

4   Pass
n = 109; y_correct = 2; assert(isequal(last_Factorial(n),y_correct))

ans = 2

5   Pass
n = 425; y_correct = 4; assert(isequal(last_Factorial(n),y_correct))

ans = 4

6   Pass
n = 14; y_correct = 2; assert(isequal(last_Factorial(n),y_correct))

ans = 2

7   Pass
n = 719; y_correct = 8; assert(isequal(last_Factorial(n),y_correct))

ans = 8

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!