X599: Factorial Example 3

Write a function in Java called factorial(int n) that will take a positive integer as input and returns its factorial as output. You will lose points if you use loops. A recursive solution is preferred.

Examples:

factorial(1) -> 1

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.