Bit manipulation

 

Write a function that prints out an integer in binary representation.

Write a function that finds the parity of an integer. The parity is 1 if there is an odd number of 1-bits in the binary representation of the integer, and 0 if there is an even number of 1-bits.

Write a program that reads in an integer and outputs the number in binary representation and the parity of the number, using the functions above.