static private ulong fact(ulong a)
factorial = factorial * i;
static private double DectoPer(double a)
static private double PertoDec(double a)
static private ulong nPr(ulong n, ulong r)
ulong nrfact = fact(n - r);
public static void Main()
string restart = "This variable will let my quit the program.";
Console.WriteLine("Please choose which option you would like to calculate");
Console.WriteLine("Press 1 for factorial, 2 to convert from decimal to percent, 3 to convert from percent to decimal, 4 to calulate the permutation of a number, 5 to calculate the combination.");
string choice = Console.ReadLine();
Console.WriteLine("Please enter what number you want the factorial of.");
number = int.Parse(Console.ReadLine());
for (i = 1; i <= number; i++)
Console.Write("Factorial of " + number + " is: " + fact);
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 percent would you like to convert to decimal?");
double ans = double.Parse(Console.ReadLine());
Console.WriteLine(ans + " = " +PertoDec(ans));
Console.WriteLine("How many total items do you have?");
ulong ans1 = ulong.Parse(Console.ReadLine());
Console.WriteLine("How many items do you want to arrange?");
ulong ans2 = ulong.Parse(Console.ReadLine());
Console.WriteLine(ans1 + "p" + ans2 + "=" + nPr(ans1, ans2));
Console.WriteLine("Please press 1, 2, 3, 4 or 5.");
Console.WriteLine(". Press q to quit the program or any other key to continue.");
restart = Console.ReadLine();