Write a python program to count total bits in a number?
Answers
Answered by
0
there are many websites which helps you
Answered by
0
Python Program to Count set bits in an integer
Write an efficient program to count number of 1s in binary representation of an integer.
Examples :
Input : n = 6
Output : 2
Binary representation of 6 is 110 and has 2 set bits
Input : n = 13
Output : 3
Binary representation of 11 is 1101 and has
Attachments:
Similar questions
Math,
7 months ago
Computer Science,
7 months ago
Math,
7 months ago
Math,
1 year ago
Math,
1 year ago