Question: C programming. Using left shift or right shift. Bit parity test is used to check if the data got corrupted while being transferred in binary

C programming. Using left shift or right shift.
Bit parity test is used to check if the data got corrupted while being transferred in binary format from one computer to another [1]. The test basically counts if there are odd number of bits or even number of bits in the data. For instance, parity of 1011 is 1 (odd number of 1s). Parity of 10001000 is 0 (even number of 1s). Given an unsigned long integer, implement a method to return the bit parity (0 for even or 1 for odd). int getBitParity inta)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
