This program already has a macro that determines whether or not anunsigned int is odd by examining the least significant binary digit.It is missing the macros for determining if the Nth least significant bitis set (counting N from the least significant bit, starting from 0),and for determining if all bits are on in a range of positions.
You must add those macros (5.0%)
A couple of sample runs are
BitOpsEnter an integer : 3131 is oddEnter an integer and a bit number : 31 331 has bit 3 onEnter an integer, start and end bit numbers : 31 2 431 has all those bits on
BitOpsEnter an integer : 3030 is evenEnter an integer and a bit number : 30 630 has bit 6 offEnter an integer, start and end bit numbers : 30 4 630 has not all those bits on(7.0%)
Reviews
There are no reviews yet.