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

 

bryce.hulett@hotmail.com > CIRC
prev  |  next  |  chance

In computer programming, a bitwise rotation, also known as a circular shift, is a bitwise operation that shifts all bits of its operand. Write the method CIRC that shifts a positive integer by the specified distance. In LCIRC or left rotation(negative distance), the bits that fall off at left end are put back at right end. In RCIRC or right rotation(positive distance), the bits that fall off at right end are put back at left end.


CIRC(16, -2) → 64
CIRC(16, 2) → 4
CIRC(65535, -3) → 524280

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

public int CIRC(int n, int distance){ }

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 Post-solution available

Copyright Nick Parlante 2017 - privacy