Finding the number of trailing zeros in N!
A simple example of finding trailing zeros in the factorial of N. public int TrailingZeroes(int n) { int result = 0; while(n!=0){ result += n/5; n = n/5; } return result; }
1 posts
A simple example of finding trailing zeros in the factorial of N. public int TrailingZeroes(int n) { int result = 0; while(n!=0){ result += n/5; n = n/5; } return result; }