subject

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? 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 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
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
English, 12.03.2022 09:20
question
Chemistry, 12.03.2022 09:30
question
Mathematics, 12.03.2022 09:30
question
History, 12.03.2022 09:30
Questions on the website: 13722360