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
ELEN [110]
3 years ago
11

The procedure call mystery(38) will yield which output? __________ a) 0 12 b) 12 0 c) 1 1 0 2 d) 1 1 1 1 e) 2 0 1 1 public void

mystery (int n) { if (n>2) mystery (n % 3); System.out.print( (n / 3) + " " ); }
Computers and Technology
1 answer:
Ivan3 years ago
3 0

Answer:

Option b is the correct answer for the above question.

Explanation:

  • The mystery function is a recursive function that calls for the two times when the user passes 38 on the argument.
  • The first value is 38 and the second value is 2 for which that function is called.
  • When the value 38 is passed, then again 2 is passed because of the "mystery (n % 3);" statement.
  • This statement holds by the if condition which gives the true when the argument value is greater than 2.
  • Hence for the 2 value the if condition will not true and the function is not called again.
  • Then the 38/3 and 2/3 are printed whose value is 12 0, but it will print 0 12 because of the recursive function.
  • Hence option b is the correct answer while the other is not because other options does not states the output of this program.
You might be interested in
A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
larisa86 [58]
<span>read/write heads should be the answer (:</span>
3 0
3 years ago
What is the best stratiget to avoid paying intrest in your credit cared
pochemuha
Paying it in full month over month.
4 0
3 years ago
Which option allows you to link to a specific slide in another presentation?
tresset_1 [31]
The power-point option for new slide. or maybe duplicate slide.
3 0
4 years ago
What is the last step in conducting a URL search
Feliz [49]
The request goes through a router or the modem to the user's ISP. 

6 0
3 years ago
Read 2 more answers
Which tool can be used to code basic HTML? Text editor JavaScript CSS HTML
makvit [3.9K]
A text editor can go good when coding HTML.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Which function is used to display a string value to the screen?
    8·1 answer
  • Consider a classStudent. The following code is used to create objects and access its member functions. Which statement is true a
    6·1 answer
  • Suppose that TCP's current estimated values for the round trip time (estimatedRTT) and deviation in the RTT (DevRTT) are 400 mse
    9·1 answer
  • Write a program that reads a floating-point number from the user and prints "zero", "positive" or "negative"
    13·1 answer
  • Jack was shocked to witness the sudden drop in performance of his laptop. He also found that the screen saver constant changed a
    14·1 answer
  • What does the action tool allow you to do in Microsoft Powerpoint?
    15·1 answer
  • Suppose users share a 1 Mbps link. Also suppose each user
    10·1 answer
  • does anyone know the what the tuition fee is for UC Berkeley PER YEAR. My smooth brain can't find it ANYWHERE.
    10·2 answers
  • Why is it important for organizations to make strong commitment to Cloud at scale?
    14·1 answer
  • Html is a markup language that lets you identify common sections of a web page
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!