Python program to extract ‘k’ bits from a given position?
Answers
Answered by
0
Answer:
Input : number = 171 k = 5 p = 2 Output : The extracted number is 21 171 is represented as 0101011 in binary, so, you should get only 10101 i.e. 21. Input : number = 72 k = 5 p = 1 Output : The extracted number is 8 72 is represented as 1001000 in binary, so, you should get only 01000 i.e 8.
Explanation:
mark me brainliest
Similar questions