07.CalculateN!/(K!*(N-K)!)

using System;
using System.Numerics;
class CalculationIntricateFactoriel
{
    static void Main()
    {
        //input
        Console.Write("Enter number for n factoriel ");
        Console.Write("in the range 1<k<n<100:");
        int numN = int.Parse(Console.ReadLine());
        Console.WriteLine("\n");
        if ((numN<= 2) || (numN >= 100))
        {
            Console.WriteLine("Invalide range.");
            return;
        }
        Console.Write("Enter number for k factoriel ");
        Console.Write("in the range 1<k<n<100:");
        int numK = int.Parse(Console.ReadLine());
        Console.WriteLine("\n");
        if ((1 >=numK)||(numK>=100)||(numK>numN ))
        {
            Console.WriteLine("Invalid range!");
            Console.WriteLine("\n");
            return;
        }
        BigInteger factorielN = 1;
        BigInteger factorielK = 1;
        BigInteger factorielDif=1;
        //Factorial of difference of the numbers n and k.
        double quotientNKDif = 0;  //quotient of n! and k!*(n-k)!.
        BigInteger difNK=0;          // Difference between n and k.
        //logic
        for (int i = 1, j=1; i <=numN;j++,i++)
        {
            factorielN = factorielN * i;
            if (j <=numK)
            {
                factorielK = factorielK * j;
            }
        }
        difNK=numN-numK;
        for (int i = 1; i <=difNK; i++)
			{
			 factorielDif=factorielDif*i;
			}
        quotientNKDif = (double)factorielN / ((double)factorielK * ((double)factorielDif));
        //output
        Console.WriteLine("{0}", quotientNKDif);
        Console.WriteLine("\n");
    }
}