The bitwise AND operator &|) is a bitwise logical
operator. It is represent by ampersand (&) symbol. It works with two
operands I.e. it is a binary operator. The comparison of bits started from the
least significant bit. It works with operands bit by bit.
The result of bitwise AND operator is 1 when both bits has 1
values. other wise the result of bitwise AND operator is 0 (zero). It mainly
used to test whether a particular bit 1 or 0 (zero). The operation table of
bitwise AND (&) operator is as
follow:
Operand A
|
Operand B
|
Result ( A & B )
|
0
|
0
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
The precedence of bitwise AND operator is lower than the
relational operator so additional parentheses are necessary.
No comments:
Post a Comment