Back to course home
0% completed
2. Factorial
Problem Statement
Calculate the Factorial of a Positive Number Using Recursion.
The factorial of a non-negative integer N, denoted as N!, is the product of all positive integers less than or equal to N. The factorial of 0 is defined as 1.
Here is what the example input/output looks like:
Input | Expected Output | Explanation |
---|---|---|
Number = 5 | Factorial = 120 | The factorial of 5 is calculated as 5 _ 4 _ 3 _ 2 _ 1 = 120. |
Number = 7 | Factorial = 5040 | The factorial of 7 is calculated as 7 _ 6 _ 5 _ 4 _ 3 _ 2 _ 1 = 5040. |
Number = 1 | Factorial = 1 | The factorial of 1 is 1 itself. |
Try it yourself
Try solving this question here:
Python3
Python3
. . . .
Mark as Completed
Table of Contents
Problem Statement
Try it yourself