how to divide the given number by 3 using bitwise operators and what are other methods without using /,*,%.operators..

Featured Replies

- 1
[code]int y = (x * 43691) >> 17;[/code] works for all unsigned ints x (32-bit) that are less than 98303. And you can implement the multiplication using bitwise operators too... (note that 43691 == 0xaaab, or 1010101010101011 in binary, and the reason this works is that (1 << 17) / … Read More

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles