define ones complement operatorthe ones


Define One's Complement Operator?

The one's complement operator, occasionally called the "bitwise NOT" or "bitwise complement" operator produces the bitwise one's complement of its operand. The operand should be of integral type. This operator performs common arithmetic conversions the result has the type of the operand after conversion.

x

~x

0

1

0

0

In the following instance the new value assigned to y is the one's complement of the original unsigned short value:

// Example of the one's complement operator

unsigned short y = 0xAAAA;  // value of y is 0xAAAA

y = ~y;                     // value of y is 0x5555

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: define ones complement operatorthe ones
Reference No:- TGS0305210

Expected delivery within 24 Hours