static private ulong fact(ulong a)
factorial = factorial * i;
static private double DectoPer(double a)
static private double PertoDec(double a)
static private double nPr(ulong n,ulong r)
ulong nrfact = fact(n-r);
static private double nCr(ulong n,ulong r)
ulong nrfact = fact(n-r);
ulong nrrfact = nfact/nrfact;
public static void Main()
Console.WriteLine("Please choose which option would you like to calculate?");
Console.WriteLine("Press 1 for factroial, 2 to convert from decimal to percent, 3 to convert from percent to decimal, 4 to calcualte premutation, 5 to calculate combination");
string choice = Console.ReadLine();
Console.WriteLine("What would you like to calculate the factorial of?");
ulong ans = ulong.Parse(Console.ReadLine());
Console.WriteLine("The factorial of " + ans + " = " + fact(ans));
{ Console.WriteLine("What decimal do you need to be a percent?");
ulong ans2 = ulong.Parse(Console.ReadLine());
Console.WriteLine(ans2+" in percent form is- " + DectoPer(ans2));
{ Console.WriteLine("What percent do you want to convert to decimal?");
ulong ans3 = ulong.Parse(Console.ReadLine());
Console.WriteLine(ans3+" in decimal form is- " + PertoDec(ans3));
Console.WriteLine("How many items do you have?");
{ Console.WriteLine("Please enter a valid number thank you!");