Ad
  • Default User Avatar

    A float probably isn't the best choice of variable type. And if you actually calculate factorial(n), you are likely to overflow a small-sized integer.

    Hint: You don't have to actually calculate factorial(n). Try shuffling the formula around.

  • Custom User Avatar

    You should provide the input for that test to check if there is a problem or not.