Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

C Programming : Lab Assignments

ASSIGNMENT 10: Bitwise Operators


1. Write a function to count number of 1 bits into a given number.
2. Write a function to display given number in binary format.
3. Modify above program to accept number as command line arguments.
4. Write a function to check whether a given byte has even parity. If not set MSB bit to make it
even parity.
5. Write a function to check whether given character is alphabet or not. If it is alphabet, perform
its bitwise XOR operation with value 32 and observe the result.
6. Write a function to swap two numbers using XOR operation.

15

SunBeam Institute of Information Technology, Pune

You might also like