In the c programming, operations can be performed on a bit level using bit wise operator
Bits that are 0 become 1, and those that are 1 become 0. For example:
bit a ~a
0 1
1 0
I have used bit wise operator in program output should be 0 but it show output -2. why does it show -2 ?
Result -2Code:#include<stdio.h> int main() { int a = 1; printf(" addition %d \n", ~a); return 0; }