static void Main(string[] args) { int threads = 1; int factorial = 1; Console.WriteLine("What number?"); string factorialString = Console.ReadLine(); Console.WriteLine("How many threads?"); string threadsString = Console.ReadLine(); if (int.TryParse(factorialString, out factorial) && int.TryParse(threadsString, out threads) && threads > 0 && factorial >= 0) { Factorial f = new Factorial(); double result = f.Calc(factorial, threads); Console.WriteLine(result); } Console.ReadKey(); }