[ create a new paste ] login | about

Link: http://codepad.org/fDg8gP9G    [ raw code | output | fork ]

mohit_at_codepad - C++, pasted on Apr 26:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
#include <math.h>

int main() {
  int i = 0;
  double lg100f = 0.0;
  for(i = 2; i <= 100; ++i) {
    lg100f += log10(i);
  }
  printf("100! has %g digits.\n", ceil(lg100f));
  return 0;
}


Output:
1
100! has 158 digits.


Create a new paste based on this one


Comments: