title: How Factorial logic works?
body: <p>I have got a code snippet to find out the factorial number for a given value. I tried to find out the code flow by debugging the snippet. But still i am confused about the flow. Below is the code snippet i have, Can anyone help me to understand the flow?</p>
  
  <pre><code>static void Main()
  {
     long value = factorial(5);
  }
  
  static long factorial(long num)
  {
     if (num &lt;= 1)
          return 1;
     else
          return num * factorial(num - 1);
  } 
  </code></pre>