factorial c#
Console.WriteLine("Enter factorial value : ");
var factorialvalue = Console.ReadLine();
var tempfactvalue = 1;
bool isnumber = double.TryParse(factorialvalue, out double n);
if (isnumber && double.Parse(factorialvalue)>0)
{
for (int i = 0; i < double.Parse(factorialvalue); i++)
{
tempfactvalue += (tempfactvalue * i);
}
}
else { Console.WriteLine("non numeric / negative value"); }
Console.WriteLine("factorial value :" + tempfactvalue);
Console.ReadLine();