subject

Consider the following recursive method, which is intended todisplay the binary equivalent of a decimal number. For example, toBinary(100) should display 1100100. public static void toBinary(int num)
{
if (num < 2)
{
System. out. print(num);
}
else
{
/* missing code */
}
}
Which of the following can replace /* missing code */ so thattoBinary works as intended?

a. System. out. print(num % 2);
toBinary(num / 2);
b. System. out. print(num / 2);
toBinary(num % 2);
c. toBinary(num % 2);
System. out. print(num / 2);
d. toBinary(num / 2);
System. out. print(num % 2);
e. toBinary(num / 2);
System. out. print(num / 2);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
Singing in the rain: this first part of the film shows the early history of motion picture. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theater productions? explain.
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
question
Computers and Technology, 24.06.2019 22:30
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
Answers: 1
You know the right answer?
Consider the following recursive method, which is intended todisplay the binary equivalent of a deci...
Questions
question
Mathematics, 15.12.2019 22:31
question
Biology, 15.12.2019 22:31
question
Mathematics, 15.12.2019 22:31
Questions on the website: 13722367