circular shift c

Posted by simion on Stack Overflow See other posts from Stack Overflow or by simion
Published on 2010-05-31T11:44:32Z Indexed on 2010/05/31 11:53 UTC
Read the original article Hit count: 229

Filed under:
|
|

I am doing some past papers and noticed a question where i have to shift the int one place to the right and return it

i no in java i can just return n >> 1;

is this possible in c? or is there a typically more compelx way of doing it :D.

The method we were given is as follows

// Return n after a right circular 1-bit shift
unsigned int right_circular_shift_1(unsigned int n) {

© Stack Overflow or respective owner

Related posts about c

    Related posts about homework