title: Calculating The Factorial of a Number
body: <p>When I enter the number 6 to calculate its factorial, it returns 30 (which is wrong).</p>
  
  <p>Why is my program producing incorrect output?</p>
  
  <pre><code>using System;
  
  namespace Scenario1_2
  {
      class Program
      { 
          static void Main(string[] args)
          {
              int counter, number, fact;
  
              Console.WriteLine("Please enter the number you wish to factorize");
              number = int.Parse(Console.ReadLine());
              fact = number;
  
              for (counter = number - 1; counter &gt;= 1; counter--)
              {
                  fact = fact * counter;
  
                  Console.WriteLine("The number you entered was {0} and it's factorial is {1}", number, fact);
                  Console.ReadLine();
              }
          } 
      }
  }
  </code></pre>