#include <stdio.h>
void main()
{
// a = 5(00000101), b = 9(00001001) // binary code
unsigned char a = 5, b = 9;
// The result is 00000001 =>1 decimal
printf("a = %d, b = %d\n", a, b);
printf("a&b = %d\n", a & b); // 00000001
// The result is 00001101 =>13
printf("a|b = %d\n", a | b);
// The result is 00001100 => 12
printf("a^b = %d\n", a ^ b);
// The result is 11111010=> 2+8+16+32+64+128=250
printf("~a = %d\n", a = ~a);
// The result is 00010010 =>2+16=18
printf("b<<1 = %d\n", b << 2); // 00100100 =4+32=36
// The result is 00000100 =>4
printf("b>>1 = %d\n", b >> 1); // 00000100
}