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 02:30
Drop in child care facilities are required to be licensed
Answers: 1
question
Advanced Placement (AP), 25.06.2019 00:00
Which is a type of tectonic plate boundary?
Answers: 2
question
Advanced Placement (AP), 26.06.2019 09:00
Why does princess aurora out of all disney princesses have purple eyes?
Answers: 1
question
Advanced Placement (AP), 26.06.2019 22:00
Asitting bill is a bill that is inactive in congress at the moment. true false
Answers: 2
You know the right answer?
Consider the following recursive method, which is intended to display the binary equivalent of a dec...
Questions
question
Mathematics, 24.03.2020 00:09
question
Mathematics, 24.03.2020 00:09
question
Mathematics, 24.03.2020 00:09
question
Mathematics, 24.03.2020 00:09
question
Mathematics, 24.03.2020 00:09
Questions on the website: 13722367