title: In order to figure the factorial of an integer, say, k, I must write a statement kfact = kfact *i. and I do not get why
body: <p>I am sort of self-learning the C language.</p>
  
  <pre class="lang-c prettyprint-override"><code>for(i=1;i&lt;=k;i++)
      kfact = kfact * i;
  </code></pre>
  
  <p>Using the mathematical formula to calculate the factorial was tried.</p>
  
  <p><code>n! = n*(n-1)*(n-2)*(n-3)....*1</code>, but I do not get how it correlates with the above mentioned code.</p>
  
  <pre class="lang-c prettyprint-override"><code>int k, kfact, i;
  kfact = 1;
  
  for(i=1;i&lt;=k;i++)
      kfact=kfact*i;
  printf("\n %d factorial is %d",k,kfact);
  return 0;
  </code></pre>