On 12/09/2011 20:47, Ryan Munson wrote:

The full exercise states:

Write a program that asks for a decimal number less than 256 and converts
it to binary. (Hint: You may want to use the bitwise and operator 8 times.)

Since 256 is 2^8, I am assuming using a computation of 2**8 is involved.

You must understand the way Perl operators function, and it seems that
you have been shown how to use bitwise 'and' operator '&'.

You have a good idea with the value of 256, but it looks like you have
not understood the binary system properly. The concept of 'masking' bits
by 'anding' them is central to Computer Science.

Good luck

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to