[ create a new paste ] login | about

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

C++, pasted on Jul 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* log10 example */
#include <stdio.h>
#include <math.h>

int main ()
{
  double result = 0.0;;

  for (int i=1; i<=12; ++i)
  {
     result += log10(i);
  }
  printf ("sum = %f \n", result);
  return 0;
}


Output:
1
sum = 8.680337 


Create a new paste based on this one


Comments: