Why my code doesnot works for number 50 or higher? for factorial it works but not for fibonacci. it seems that it calculates something but always black console there
using System;
using System.Numerics;
namespace Training_Project
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(Fib(50));
Console.WriteLine(Factorial(100));
}
static BigInteger Factorial(int n)
{
if (n == 0)
return 1;
else
return n * Factorial(n - 1);
}
static BigInteger Fib(int n)
{
if (n <= 2)
return 1;
return Fib(n - 1) + Fib(n - 2);
}
}
}