Tag Archives: bitwise-operations

2’s complement : Hackerrank

Problem link: https://www.hackerrank.com/challenges/2s-complement

Problem Statement:
One of the basics of Computer Science is knowing how numbers are represented in 2’s complement. Imagine that you write down all numbers between A and B inclusive in 2’s complement representation using 32 bits. How many 1’s will you write down in all ?
Continue reading