Which bitwise operator is used to flip the bits (change 1s to 0s and vice versa) of a binary number?
- &
- |
- ^
- ~
The ~ operator is the bitwise NOT operator in C++. It inverts each bit of a number, changing 1s to 0s and 0s to 1s. & is the bitwise AND, | is the bitwise OR, and ^ is the bitwise XOR operator.
Loading...
Related Quiz
- Which file opening mode in C++ will allow you to append data at the end of the file’s content?
- The keyword _______ is used to specify that a function should be compiled inline.
- How does the C++ compiler handle tail-recursive functions?
- Which function is used to get the position of the file pointer in a file?
- Which of the following is not a legitimate reason to use function templates?