1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sertanlavr [38]
3 years ago
14

public static int recur(int x) { if (x >= 0) return x + recur(x - 1); return 0; } What is returned by the method call recur(9

)?
Advanced Placement (AP)
1 answer:
guapka [62]3 years ago
6 0
9 >= 0 so return 9 + ...
8 >= 0 so return 8 + ...
7 >= 0 so return 7 + ...
6 >= 0 so return 6 + ...
5 >= 0 so return 5 + ...
4 >= 0 so return 4 + ...
3 >= 0 so return 3 + ...
2 >= 0 so return 2 + ...
1 >= 0 so return 1 + ...
0 >= 0 so return 0 + ...
-1 is not >= 0 so return 0.

Now string together all the returns..
9+8+7+6+5+4+3+2+1+0+0=45

recur(9) returns 45
You might be interested in
Who is percy jacksons brother need it for my test please and thnks
rjkz [21]
Percy Jackson's brother is Tyson and he's a cyclops.

4 0
3 years ago
Read 2 more answers
compare the social system of europe from the period 400-1450 to those of south asia. Give one similarity and one difference. ASA
Strike441 [17]
The similarity between the social system is the hierarchy that created in society based on the job that held by individuals.
The main difference is the openness. South Asian culture directly acknowledge the discrimination while the European culture masked it even though the nobles held all the power in the society.
7 0
3 years ago
Which statement regarding the impact of globalization
eimsori [14]

Answer:

a

Explanation:

4 0
3 years ago
What are the economic benefits of having imperial territories?
stiks02 [169]
This link should be much helpful to your question and provide more than what you are asking to https://infogr.am/alexgrey_1398868104
7 0
3 years ago
James purchased 3 pounds of steak for $21. Which equation can be used to determine the cost, y, to purchase x pounds of steak?
ra1l [238]
3x=21y I think is how you would do this
7 0
3 years ago
Other questions:
  • How are alleles formed?
    7·1 answer
  • Assume that your classmate suggested that both graphs represent constant opportunity costs because movement from combinations A
    10·1 answer
  • Describe the relationship between x and y
    10·1 answer
  • Compare the views of Walker and Colton, and evaluate their use of republican and religious ideology to support their arguments.
    11·1 answer
  • The main goal of the Seneca Falls Convention (1848) was to
    7·1 answer
  • Regions with a significant and sustained decrease in tree cover have also been found to experience longer periods of drought. In
    8·1 answer
  • Ano ang sistemang Encomienda​
    6·1 answer
  • The diameter is 9in find it's circumference in terms of piπ
    7·1 answer
  • 5. Paano naman kayan matugunan ng mga sakop na bansang asyanao ang mga kakulanga ng yamang likas gaya ng tubig?​
    13·1 answer
  • If marie curie, james madison, and mahatma Gandhi had all taken an intelligence test and scored poorly, most people would doubt
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!