bitwise programs in c,bitwise operator program in c,bitwise programming in c
Explain Bit wise Operators in C Bitwise AND,Bitwise Inclusive OR,Bit wise Exclusive OR,Unary complement (bit inversion),Shift Left,Shift Right,sizeof()
Explain Bitwise Operators in C
Bitwise Operators
Bitwise operators modify variables or shifting the bit left or right patterns that represent the values they store.
operator | asm equivalent | description |
& | AND | Bitwise AND |
| | OR | Bitwise Inclusive OR |
^ | XOR | Bitwise Exclusive OR |
~ | NOT | Unary complement (bit inversion) |
<< | SHL | Shift Left |
>> | SHR | Shift Right |
sizeof()
This operator will accept one parameter, which
can be a variable itself and returns the size of it in bytes of that type or
object.
|
This will assign the value 1 to a becausechar is a one-byte long
type. The value returned by sizeof
is a constant, so it is always determined before program execution.