#include int main(int argc, char ** argv) { unsigned char x; unsigned char y; unsigned char result; printf("Enter, as two hex digits, value of x: 0x"); scanf("%hhx", &x); printf("x = %d (0x%2.2x)\n", x, x); printf("Enter, as two hex digits, value of y: 0x"); scanf("%hhx", &y); printf("y = %d (0x%2.2x)\n", y, y); result = ~x; printf("\n ~x = %d (0x%2.2x)\n", result, result); result = x & y; printf(" x & y = %d (0x%2.2x)\n", result, result); result = x | y; printf(" x | y = %d (0x%2.2x)\n", result, result); result = x ^ y; printf(" x ^ y = %d (0x%2.2x)\n", result, result); result = !x; printf(" !x = %d (0x%2.2x)\n", result, result); result = x && y; printf("x && y = %d (0x%2.2x)\n", result, result); result = x || y; printf("x || y = %d (0x%2.2x)\n", result, result); }