Easiest to understand


#1

int Solution::trailingZeroes(int A)
{
if(A<5) return 0;
int count = 0;
A = A-A%5;
while(A!=0)
{
count += A/5;
A/=5;
}
return count;
}