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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, Morganwing1019
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
image
Computers and Technology, 23.06.2019 11:00, la200564
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
image
Computers and Technology, 25.06.2019 00:10, dnicole43
Select the correct answer sarah wants to use a device to input signatures on electronic documents. which input device will be most suitable for her? a digital pen b. laser pen c keyboard d. touchscreen reset next
Answers: 2
image
Computers and Technology, 25.06.2019 01:30, jeff6284
Ashort circuit locator should be periodically run along the cords used in a shop to check for shorts and open circuits. a.)true b.)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 in other subjects:

Konu
Mathematics, 16.04.2020 00:35