Respuesta :

tonb
int factorial(int n)
{
   if (n <= 1) {
      return 1;
   }
   else {
      return n* factorial(n - 1);
   }
}

With recursive functions, always check that there is a certain end criterium. When n<=1, the recursion stops.