Would my code work?

here is my code:

#include<bits/stdc++.h>
using namespace std;

int c2(int n){
int p = 0,c=0;
while(pow(2,p)<n){
c+=n/pow(2,p);
}
return c;
}

int c5(int n){
int p = 0,c=0;
while(pow(2,p)<n){
c+=n/pow(2,p);
}
return c;
}

int main() {
int i,j,n;
cin>>n;
j=c2(n);
i=c5(n);
if(i>=j){cout<<j;}
else{cout<<i;}
return 0;
}

hi @\ you can try submitting it on hackerblocks and see for yourself :slight_smile:

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.