I have to shift the int one place to the right and return it
In Java i can just return n >> 1;
Is this possible in C?
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) {
C does not have a circular shift, so I guess the exercise is to implement it. The way to do this for a left circular shift is to:
For a right circular shift: