Question: What does the following code do? public int mystery(int a, int b) { if (b == 1) { return a; } else { return a
What does the following code do?
public int mystery(int a, int b) {
if (b == 1) {
return a;
}
else {
return a + mystery(a, b - 1);
}
}
Step by Step Solution
3.49 Rating (152 Votes )
There are 3 Steps involved in it
The method adds a ... View full answer
Get step-by-step solutions from verified subject matter experts
