Bitwise Operators in C

The bitwise operators are the operators used to perform the operations on the data at the bit-level. When we perform the bitwise operations, then it is also known as bit-level programming. It consists of two digits, either 0 or 1. It is mainly used in numerical computations to make the calculations faster.

| Bitwise OR
& Bitwise AND
^ Bitwise XOR
~ Bitwise NOT
<< Left shift
>> Signed right shift

Source Code

//Bitwise Operators
int main()
    int a=25,b=45,c;
    printf("\n Bitwise And : %d",a&b);
    printf("\n Bitwise Or  : %d",a|b);
    printf("\n Bitwise Xor : %d",a^b);
    printf("\n Bitwise Not : %d",~a);
    printf("\n Left Shift  : %d",b);
    printf("\n Right Shift : %d",c);
    return 0;
To download raw file Click Here


 Bitwise And : 9
 Bitwise Or  : 61
 Bitwise Xor : 52
 Bitwise Not : -26
 Left Shift  : 64
 Right Shift : 4

List of Programs

Sample Programs

Switch Case in C

Conditional Operators in C

Goto Statement in C

While Loop Example Programs

Looping Statements in C

For Loop Example Programs

Array Examples in C

One Dimensional Array

Two Dimensional Array in C

String Example Programs in C

Functions Example Programs in C