title: factorial of n numbers using c# lambda..?
body: <p>I just started playing with lambdas and Linq expression for self learning. I took the simple factorial problem for this. with the little complex scenario where find the factorial for given n numbers (witout using recursive loops). </p>
  
  <p>Below the code i tried. But this is not working.</p>
  
  <pre><code>public void FindFactorial(int range)
  {
  
      var res = Enumerable.Range(1, range).Select(x =&gt; Enumerable.Range(0, x).Where(y =&gt; (y &gt; 1)).Select(y =&gt; y * (y-1)));            
      foreach (var outt in res)
          Console.WriteLine(outt.ToString());
  
  }
  </code></pre>
  
  <p>this is the procedure i used</p>
  
  <ul>
  <li>loop through the numbers 1 to n  -- <strong>Enumerable.Range(1, range).</strong></li>
  <li>select each number x and again loop them upto x times (instead of
  recursion)</li>
  <li>and select the numbers <strong>Where(y => (y > 1))</strong> greater than 1 and multiply that with
  <strong>(y-1)</strong></li>
  </ul>
  
  <p>i know i messed up somewhere. can someone tell me whats wrong and any other possible solution.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>i am going to let this thread open for some time... since this is my initial steps towards lambda.. i found all the answers very useful and informative.. And its going to be fun and great learning seeing the differnt ways of approaching this problem.</p>