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
Get step-by-step solutions from verified subject matter experts
