You are on page 1of 17

BIT

MANIPULATION
By: Tejas Sharma
Bit Manipulation
Bit manipulation is the process of applying logical operations on a sequence of bits, the
smallest form of data in a computer, to achieve a required result. Bit manipulation has
constant time complexity and process in parallel, meaning it is very efficient on all
systems.
Bitwise Operators

• Binary AND : &


• Binary OR : |
• Binary XOR : ^
• Binary NOT : ~
• Binary Left Shift : <<
• Binary Right Shift: >>
Binary AND &
Binary OR |
Binary XOR ^
Binary NOT ~
Binary Left Shift <<
Binary Right Shift >>
Questions
Q. Write a program to determine wheather a number is odd or even
Questions
Q. Write a program to determine wheather a number is odd or even
Questions
Q. Write a program to determine to toggle the case of given characters
Questions
Q. Write a program to determine to toggle the case of given characters
Questions
Q. Write a program to find the element in the array which is not repeated.
You have an array of length 2n+1 where n is np. of elements.
Questions
Q. Write a program to find the element in the array which is not repeated.
You have an array of length 2n+1 where n is np. of elements.
Questions
Q. Set the ith bit of the given array.
Thank You

You might also like