https://ide.codingblocks.com/s/253088 sir in my code tle is show tell me the approach to remove tle
Trailing zereos hackerblockes
while(f>0)
{
if(n%10==0)
c++;
n=n/10;
}
you are not modifying f, so it will go into infinite loop.
and also your logic would fail for large numbers.
Correct logic :
int ans = 0;
while(n>0){
ans += n/5;
n = n/5;
}
count<<ans;
Okay sir i will try it
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.