Examples of Bitwise Operator Application – Basic Elements, Primitive Data Types, and Operators

Examples of Bitwise Operator Application Click here to view code image char v1 = ‘)’;          // Unicode value 41byte v2 = 13;int result1 = ~v1;      // -42int result2 = v1 & v2;  // 9int result3 = v1 | v2;  // 45int result4 = v1 ^ v2;  // 36 Table 2.32 shows how the result is … Read more

Boolean Logical Operators: !, ^, &, | – Basic Elements, Primitive Data Types, and Operators

2.14 Boolean Logical Operators: !, ^, &, | Boolean logical operators include the unary operator ! (logical complement) and the binary operators & (logical AND), | (logical inclusive OR), and ^ (logical exclusive OR, also called logical XOR). These operators can be applied to boolean or Boolean operands, returning a boolean value. The operators &, … Read more