subject
Advanced Placement (AP), 09.04.2021 20:40 nick607

Consider the following recursive method, which is intended to display 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 that toBinary works as intended?

System. out. print(num % 2);
toBinary(num / 2);
A

System. out. print(num / 2);
toBinary(num % 2);
B

toBinary(num % 2);
System. out. print(num / 2);
C

toBinary(num / 2);
System. out. print(num % 2);
D

toBinary(num / 2);
System. out. print(num / 2);
E

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 23.06.2019 04:31
Based on your observations of porto alegre and houston, what would you conclude about the longest and shortest days for the two cities on opposite sides of the equator
Answers: 2
question
Advanced Placement (AP), 24.06.2019 21:00
You are a psychologist who has been asked to write a brief report about the possible causes of anxiety (nervousness, fears, in your report, write up a summary that explains and examines anxiety according to each of the psychological perspectives: psychoanalytic behavioral cognitive humanistic biological sociocultural
Answers: 1
question
Advanced Placement (AP), 25.06.2019 06:30
You are only allowed to use tutors that your school recommends. t / f
Answers: 2
question
Advanced Placement (AP), 26.06.2019 14:40
Will give ! need latin ! translate the following sentences ! bellum ab romanis in (against) graecos gestum est puellae ab nautus graecos pugnare gladiis doctae sunt dona magna ab pueris pulchris puellis parvis data erunt maga regni ab regina mala amatur ( dont use translators)
Answers: 1
You know the right answer?
Consider the following recursive method, which is intended to display the binary equivalent of a dec...
Questions
question
Mathematics, 13.07.2021 16:20
question
Business, 13.07.2021 16:20