Site icon Narayana Tutorial

Bitwise Operators

Bitwise Operators

Bitwise Complement Operators ( ~ )

We can apply this operator only for integral datatype but not for boolean types.

Negative numbers are represented in 2’s complement form

MSB—-> represent sign bit

0 means   +ve

1 means   -ve

Boolean Complement Operator ( ! )

Note:-
&, !, ^ ==> Applicable for boolean and integral types.
~ ==> Applicable only for integral types.
! ==> Applicable only for boolean types.