how can i find how many digits "0" end record number N!(factorial N) in K-ary number system.
for example if N=10000 and K=10 answer is 2499, if N=123456789 and K=4800 answer is 15432096.
Calculate the number, then go trough it and count the 0s:
1 2 3 4 5 6 7 8 9 10
int n;
int zeros = 0;
///calculate n
do
{
int digit = n%10; //returns the last digit. For example, 15%10 = 5
if(digit == 0) {zeros++;} //if the last digit is 0, add one to the zero count
n=n/10; //divide n by 10 to get rid of the last digit; 123/10=12
}while(n>0); //keep doing it untill the number is 0