nacirfabeauty7418 nacirfabeauty7418
  • 02-06-2022
  • Computers and Technology
contestada

Consider the following method: public int mystery(int n) { if(n > 6) { return 1 mystery(n - 1); } return n % 3; } What is the value of mystery(10)

Respuesta :

rekhasmileforever
rekhasmileforever rekhasmileforever
  • 15-06-2022

Answer:

Ans1--- The output is 9 Explanation--- mystery(5)=mystery(4)+2 mystery(4)=mystery(3)+2 mystery(3)=mystery(2)+2 mystery(2)=2+1=3

Answer Link

Otras preguntas

Do you think the generalization that all organisms are composed of cells was established using controlled experiments or multiple observations
What is the time difference between the UK and the west coast of the USA?
What is perceiving cause and effect relationship
Could 7.7 cm, 4.0 cm, and 1.7 cm be the side lengths of a triangle?
If the pk values for phosphoric acid are 2.15, 6.82 and 12.38, _____ would predominate at ph 5 while _____ would predominate at ph 10.
Mass=1.01 kg; volume =1000cm3
PLEASE HELP ASAP!!! CORRECT ANSWERS ONLY PLEASE!!!
The ratio of potatoes to tomatoes is 4:8 respectively. If the total number of vegetables is 36,how many tomatoes are there?
What is one of the most widely used techniques to determine infants' normative standing? it includes 27 separate categories of responses that constitute 4 gener
How can chemical symbols prove that cubic zirconia is not a diamond?