167k views
3 votes
Given the following code, how many calls (including the original call) to theprintX method would be made if we called with printX(20, 15); ?

public static void printX(int x, int y) {
System.out.print(x + " ");
if (x > y) {
printX(x - 1, y);}
a. 1
b. 3
c. 6
d. 10

User Alvas
by
7.6k points

1 Answer

4 votes

Answer:

6

Step-by-step explanation:

Given the following code, how many calls (including the original call) to theprintX-example-1
User YashArora
by
7.8k points