C#C
C#3y ago
Cloudy

❔ Why does factorial stop working at 33?

    public static void Main(string[] args)
    {
        Console.WriteLine(Factorial(33)); // 3400198294675128320
    }

    public static long Factorial(int i)
    {
        if (i <= 1)
            return 1;
        return i * Factorial(i - 1);
    }

The correct answer should be 8.6833x10^36
Was this page helpful?