r/ProgrammingProblems • u/WeAreButFew • Jan 02 '11
Last nonzero digit of 12345678!
How would you find the last nonzero digit of a large factorial?
12
Upvotes
r/ProgrammingProblems • u/WeAreButFew • Jan 02 '11
How would you find the last nonzero digit of a large factorial?
View all comments
Show parent comment
3
u/green_beet Jan 02 '11
But, if 2 * 7 = 4 (mod 10), don't you still need to worry about 2?