-2

I know the way to compute digits of factorial in the following manner.

let digits of n! to be found.

temp = 0.0;
for(i = 1; i <= n; i++){ 
temp += log(i);
}
result = (int)temp;
result++;

i'm here looking for more efficient way to count digits of factorial.

N.B: please ans in coding with C++

mhkm
  • 1
  • 2

1 Answers1

-1

the pythonic solution for this problem:

len(list(str(num)))

in c for computing digits of every number you can use this code:

int c=2;
while((num/10)>10) {
    num=(int)a/10;
    c++;
    }
Sara Santana
  • 1,001
  • 1
  • 11
  • 22