Asked by Ch.keerthi Reddy on Sep 28, 2024

verifed

Verified

What is the value returned when the integer 5 is the argument to the factorial method?

A) 15
B) 50
C) 100
D) 120

Factorial Method

A method, often implemented using recursion, to calculate the factorial of a given number, multiplying all positive integers up to that number.

  • Apply recursion to solve problems by writing recursive methods, including factorial and power computations.
verifed

Verified Answer

NP
Natalia Petushenko1 day ago
Final Answer :
D
Explanation :
If the integer 5 is the argument to the factorial method, then the value returned would be 5! = 5 x 4 x 3 x 2 x 1 = 120. Therefore, the best choice is D.