Question: USING JAVA Using integer math any number will eventually reach zero if you repeatedly divide it by 2. For example: 19 / 2 = 9

USING JAVA

Using integer math any number will eventually reach zero if you repeatedly divide it by 2. For example: 19 / 2 = 9 / 2 = 4 / 2 = 2 / 2 = 1 / 2 = 0 Given a positive integer return a String of comma separated values showing the progression of repeatedly dividing by 2 until zero is reached. The example above would return 19,9,4,2,1,0

log2Prog(1) "1,0" log2Prog(2) "2,1,0" log2Prog(3) "3,1,0"

Begin code with:

public String log2Prog(int num) {

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!