Question 96
What is the return value of mystery(16)?
CODE
int mystery(int n) {
if (n <= 1) return 0;
return 1 + mystery(n / 2);
}Detailed Solution
Calculates floor(log2(16)) = 4.
✓ Saved