cstutoringcenter.com logo
E-mail:Password:

Become a premier member today to gain access to exclusive
member benefits! Just $5.00 to join FOR LIFE!






Your Ad Here

Problem  20
Binary Numbers

Bookmark and Share

In computers, everything is represented by 1s and 0s. This is called a binary number.

As an example, the integer 5 is represented in binary form by 101. This means, working from right to left:

1*2^0 + 0*2^1 + 1*2^2 = 1+0+4 = 5

Given an input file (decimals.txt) of 500 integers, how many 1s IN TOTAL appear in the file in each numbers binary representation?

Say you had the numbers 5, 7 and 10

5 = 101
7 = 111
10 = 1010

Total number of 1s: 7
Thanks to manfred-burmeister for the clarification!

**Register or login to submit the answer & earn 25 rewards points!
(or 50 if you're a premium member)!**

Total solved
162 members
Click here to see them!
Date added
2008-10-22
Leader Board
View it here