static private ulong fact(ulong a,)
factorial = factorial * i;
static private ulong nPr(ulong n,ulong r)
return fact(n) / fact(n-r);
static private double DectoPer(double a)
static private double PertoDec(double a)
static private ulong nCr(ulong n, ulong r)
return fact (n) / fact(n - r) * fact(r));
static private float mn(float n1, float n2, float n3, float n4, float n5)
return (n1 + n2 + n3 + n4 + n5) / 5;
public static void Main()
string restart = "chicken nugget";
Console.WriteLine("welcome to the probability calculator.");
Console.WriteLine("Press 1 for factorial");
Console.WriteLine("press 2 for permulations");
Console.WriteLine("3 for decimal to percent");
Console.WriteLine("4 for percent to decimal");
Console.WriteLine("5 for combination");
Console.WriteLine("6 to find the mean for 5 numbers");
string choice = Console.ReadLine();
Console.WriteLine("What number would you like to calculate the factorial of?");
ulong input = ulong.Parse(Console.ReadLine());
Console.WriteLine(input + "! = " + fact(input));
Console.WriteLine("How many total objects do you have?");
ulong input1 = ulong.Parse(Console.ReadLine());
Console.WriteLine("How many objects would you like to arrange?");
ulong input2 = ulong.Parse(Console.ReadLine());
Console.WriteLine(input1 + "P" + input2 + "=" + nPr(input1, input2));
Console.WriteLine("What decimal would you like to convert to percent");
double ans = double.Parse(Console.ReadLine());
Console.WriteLine(ans + " = " + DectoPer(ans));
Console.WriteLine("What decimal would you like to convert to decimal");
double ans = double.Parse(Console.ReadLine());
Console.WriteLine(ans + " = " + PertoPer(ans));
Console.WriteLine("How many objects do you have in choose?");
ulong input1 = ulong.Parse(Console.ReadLine());
Console.WriteLine("How many objects do you have to arrange?");
ulong input2 = ulong.Parse(Console.ReadLine());
Console.WriteLine(input1 + "C" + input2 + "=" + nCr(input1, input2));
Console.WriteLine("Please enter a number");
Console.WriteLine("Please enter an number 1 through 6