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 04:00
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
question
Computers and Technology, 22.06.2019 09:50
Assume that you have an sorted array of records. assume that the length of the array (n) is known. give two different methods to search for a specific value in this array. you can use english or pseudo-code for your algorithm. what is the time complexity for each algorithm and why?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
You know the right answer?
Consider the following recursive method, which is intended to display the binary equivalent of a dec...
Questions
question
Mathematics, 21.10.2020 01:01
question
Mathematics, 21.10.2020 01:01
Questions on the website: 13722367