Write a function that takes an integer and counts the number of bits.
Anonymous
void count_Bits(int inp){ int count = 0; for (int y = inp; y >=1;y = y /2 ){ count++; } cout<< "number of bits : " << count<< endl; }
Check out your Company Bowl for anonymous work chats.