If you posted your code and explain the problem, people will make suggestion for it.
If you have Microsoft Windows 7 calculator, set it to programming mode, then you can select BIN or DEC mode. For any number, you look the DEC mode, then click BIN to see binary mode. Then you can see how bitwise operator actually can work on particular bit, instead of setting whole number to zero or one.