Question: 1) Write a program that converts a given positive integer to its binary representation. Hint: write the program using a for loop. To get the

1) Write a program that converts a given positive integer to its binary representation. Hint: write the program using a for loop. To get the number of bits in a given integer, use the function bit_length() in python. For example, for a = 983265982365, a.bit_length() will be 40. Test your program with following integers: a = 87324834345, a = 65234242, a = 576762341243968. Compare your results with the built-in function bin(int a) in python
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
