0 votes
60 views
in General by (0 points)
closed by
Consider the following recursive method
public int foo(int x, int y) {
 if(x == y) return 0;
 else return foo(x-1, y)+1;
}
If the method is called as foo(8, 3), what is returned?
a. 11
b. 8
c. 5
d. 3
closed

1 Answer

0 votes
by (0 points)
 
Best answer
c

Related questions

0 votes
1 answer 71 views
0 votes
1 answer 52 views
0 votes
1 answer 158 views
0 votes
1 answer 324 views

2.8k questions

2.8k answers

0 comments

76 users

Welcome to MCQ Village Q&A, where you can ask questions and receive answers from other members of the community.
...