Home >Backend Development >C#.Net Tutorial >What are the bitwise operators in C language?
The bitwise operators in C language are: 1. [&] bitwise AND; 2. [|] bitwise OR; 3. [^] bitwise XOR; 4. [~] negation; 5. [f1bffa15d0cc3ab97f9936f92efe147e>] Move right.
[Related learning recommendations: C language tutorial video]
The bitwise operators in C language are:
Bitwise operations are unary and binary operations on bitwise or binary numbers in bit mode in programming.
On many older microprocessors, bit operations are slightly faster than addition and subtraction operations, and usually bit operations are much faster than multiplication and division operations.
In modern architectures, this is not the case: bitwise operations often operate at the same speed as addition operations (still faster than multiplication operations).
Bit operators are used to operate on binary bits. Java provides bit operators as shown in the following table: Among the bit operators, except ~, the rest are binary operators.
The operands can only be integer and character data.
Six bitwise operators in C language:
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~Negation
f9dfb993db9dc8581cf4a8f96f92dcb1>Shift right
main() { int a=9,b=5,c; c=a&b; printf("a=%d\nb=%d\nc=%d\n",a,b,c); }
The above is the detailed content of What are the bitwise operators in C language?. For more information, please follow other related articles on the PHP Chinese website!