can we write the function as:
int findzeroes(int n)
{
int ans=1;
while(ans>=1)
{
ans = ans+(n/d);
d=d*5;
}
ans–;
cout<<ans;
}
can we write the function as:
int findzeroes(int n)
{
int ans=1;
while(ans>=1)
{
ans = ans+(n/d);
d=d*5;
}
ans–;
cout<<ans;
}
long long base = 5;
int ans = 0;
while(true){
int curr = A/base;
ans+= curr;
if(curr<= 0 )return ans;
base*=5;
}
return 0;
consider using the above code where A is the number input from user
there is a run time error in ur code
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.