int factorial(int n)
      {
        if (n == 0)
          return 1;
        return n * factorial(n - 1);
      }

      Java language logoFactorial of a number

      Java Recipes

      The code calculates the factorial of an input using the return statement.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.