35 Answers

New AnswerGiven a base-10 integer, n, convert it to binary (base-2). Print a single base-10 integer denoting the maximum number of consecutive 1's in the binary representation of n. Sample Input : 5 Sample Output : 1 The binary representation of 5 is 101, so the maximum number of consecutive 1's is 1. Sample Input : 13 Sample Output : 2 The binary representation of 13 is 1101, so the maximum number of consecutive 1's is 2. HappyCodings!:-)

1/24/2018 2:53:45 PM

Danijel Ivanović35 Answers

New AnswerMy entry https://code.sololearn.com/cmvDMS0pHvFA/?ref=app

Another one in C https://code.sololearn.com/cSf7NoRW9l5T/?ref=app

Hot Today

What's wrong with my code?
What's the most significant advantage of using virtual functions in comparison with pure polymorphism ?
Что не так? Написал программу для нахождения дискриминанта и корней уравнения
What is wrong with this?
Code Coach - Word Rank. Please see my code. It failed all the test cases.
How to learn html and css
Please I need an explanation from lines 58 to the end
Rock,paper,scissors buttons are not working as they are supposed to be. Would you mind helping me with this?(solved)
What is the easiest python framework should I learn from here?
How can I answer another comment?

Sololearn Inc.

535 Mission Street, Suite 1591San Francisco, CA 94105

© 2022 Sololearn, Inc.

Send us a message