#Matlab, 13 bytes
de2bi
creates a vector of zeros and ones representing the binary number, and sum
just returns the sum of all the entries.
sum(de2bi(n))
#Matlab, 13 bytes
de2bi
creates a vector of zeros and ones representing the binary number, and sum
just returns the sum of all the entries.
sum(de2bi(n))