String Challenge Have the function String Challenge (str) take the str parameter being passed, which will be a positive integer, take its binary representation (padded to the nearest N*8 bits), reverse that string of bits, and then finally return the new reversed string in decimal form. For example: if str is "47" then the binary version of this integer is 101111 but we pad it to be 00101111. Your program should reverse this binary string which then becomes: 11110100 and then finally return the decimal version of this string, which is 244. Examples Input: "213"
Answers
Answered by
2
Explanation:
input:"213"
output:171
Similar questions
Hindi,
9 days ago
English,
19 days ago
Math,
19 days ago
Hindi,
8 months ago
CBSE BOARD X,
8 months ago