Computer Science, asked by MarciaRoyal6304, 1 year ago

Write a python program to count total bits in a number?

Answers

Answered by ayushjaa
0

there are many websites which helps you

Answered by IASofficer
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