title: Approaching Dynamic Programming
body: <p>I have written a small program to calculate the factorial of a number using Dynamic Programming Technique.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int fact(int n)
  {
      int f[n],i;
      f[0] = 1;
  
      for(i=1;i&lt;=n;i++)
          f[i] = i * f[i-1];
      return f[n];
  }
  
  int main(void)
  {
      printf("\n Factorial of %d is %d ",5,fact(5));
      return 0;
  }
  </code></pre>
  
  <p>Is the approach of <strong>memorization</strong> correct? Because, dynamic programming involves recursion. But I have not included it here. So I am not sure of my approach.</p>