It's something I'm doing for extra credits and I don't know how and where to startHow to write a program that computes the number of 鈥?鈥?bits in a given 32-bit integer number in VB?
I'll give you a c-sorta algorithm
Assume the number is in x
count = 0;
while (x != 0) {
if ((x mod 2) == 1) count++;
x = x / 2;
}
print count;
No comments:
Post a Comment