/ * Consider a program here */
main()
{
int a=7;
~a;
printf("%d",a);
}
output=?
It is a tilde symbol in your keyboard. In C programming (even C++ and C#), it is used as bitwise NOT operator. In your sample program, it means to ' not A' or 'not equal to A or 7' since A = 7.
So the logic will be (in binary):
0111 = 7
and it's because it is not equals to 7 which is 0111, we will flip or reverse these bits into:
1000 = 8
So the output will be:
8