Trailing Zeros in Factorial

https://www.interviewbit.com/problems/trailing-zeros-in-factorial/
int Solution::trailingZeroes(int A) {
    int c=0;
    while(A>0)
    {
        c+=A/5;;
        A=A/5;
    }
    return c;
}


 

Comments

Popular posts from this blog

Perfect Peak of Array

Is Rectangle?

Sort array with squares!