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

      Cpp language logoFactorial of a number

      Cpp recipes

      The function factorial takes an unsigned integer as a parameter and return the value of factorial multiplied by the value of its parameter - 1.


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.