id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > radSumBinary
prev  |  next  |  chance

Write a method that recursivley returns the sum of the binary digit representation of the parameter 'num'. For example, if num=21, you would return 3 because the binary representation for 21 is 10101 which has a digit sum of 3. Your solution must be recursive!


radSumBinary(14) → 3
radSumBinary(55) → 5
radSumBinary(67) → 3

...Save, Compile, Run (ctrl-enter)

public int radSumBinary(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 330

Copyright Nick Parlante 2017 - privacy