Solved

Example Code Ch 12-2

Question 38

Multiple Choice

Example Code Ch 12-2
Given the following recursive factorial method:
public int factorial(int x)
{
if (x > 1) return x * factorial (x - 1) ;
else return 1;
}
-Refer to Example Code Ch 12-2: What is returned if factorial(3) is called?


A) 0
B) 1
C) 3
D) 6
E) 9

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions