I want to determine the last nonzero digit of a factorial.
I tried to solve it using division: Dividing the number by 10 or multiples thereof.
Ex : 7! = 5040 => 4
So I divide 5040 by 10 and get 4 as result.
But, let us say, we should use the number 7 in the logic instead of value of the factorial (5040).
Please let me know how can I do it?