#include <stdio.h>
int main() {
int a = 0xA;//1010
int b = 10;
a = a & (1<<1);
/*b = b ^ (1<<0);
b = b ^ (1<<2);*/
//or
b = b ^ (1<<0) ^ (1<<2);
int c = 0xABC;
int extract1 = (c & 0xF00) >> 8;
int extract2 = (c & 0x0F0) >> 4;
printf("%d\n",a);
printf("%X\n",b);
printf("%X %X", extract1, extract2);
}
To embed this program on your website, copy the following code and paste it into your website's HTML: