Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

a C++ function that takes a positive x value and returns the number of time we can divide x by 2

OpenStudy (anonymous):

ur question is vague can u post the whole question?

OpenStudy (rsmith6559):

int numTimesDivideByTwo( int number) { if( number < 2 ) return 0; else return( ( numTimesDivideByTwo( (int)number / 2 ) ) + 1 ); }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!