title: Counting error while calculating large number(e.g. 50!)
body: <p>My code is doing well when I enter small numbers like <code>10</code> choose <code>2</code>, but when it comes to <code>50</code> choose <code>10</code>, its result is wrong, can you tell me what's wrong here?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  long long int factorial(int n);
  long long int combn(int n, int k);
  
  int main(void) {
      int n = 0;
      int k = 0;
      printf("Enter n and k:\n");
      scanf("%d %d", &amp;n, &amp;k);
      combn(n, k);
  }
  
  long long int combn(int n, int k) {
      long long int C = 0;
  
      C = factorial(n) / (factorial(k) * factorial(n - k));
      printf("C %d choose %d = %ld\n", n, k, C);
  }
  
  long long int factorial(int n) {
      if (n == 1)
          return 1;
      else
          return n * factorial(n - 1);
  }
  </code></pre>
  
  <p><code>combn(50, 10)</code> should be <code>10272278170</code>.</p>