I am in 11th grade and I am learning C#. While I tried to do a factorial recursion function that divides 1 by the factorial number. When I run it it gives me the error of "Unhandled exception. System.DivideByZeroException: Attempted to divide by zero." I didn't divide anything by zero... If you can help me and explain the problem it will be very helpful, thanks a lot.
static int FactorialRecursion(int num)
{
if (num == 1)
{
return 1;
}
return 1 / (num * FactorialRecursion(num - 1));
}