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

 

frew@mclean.com unit5day1 > divideBy2
prev  |  next  |  chance

Write a method named divideBy2 that accepts an integer parameter and returns how many times the number can be divided by 2 without a remainder. For example, the call divideBy2 (128) should return 7 and divideBy2 (1235) should return 0. The call divideBy2 (244) should return 2.


divideBy2(128) → 7
divideBy2(1235) → 0
divideBy2(244) → 2

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

public int divideBy2(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: 200

Copyright Nick Parlante 2017 - privacy