static void Main(string[] args) { int a; Console.WriteLine("Enter the number: "); a = Convert.ToInt32(Console.ReadLine()); Program p = new Program(); Console.WriteLine("Factorial of {0} is: {1}", a, p.Fact(a)); Console.ReadKey(); }