
05-17-2007
|
 |
Unix Daemon
|
|
Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,718
|
|
Quote:
|
Originally Posted by dLloydm
There is one more thing I would like to verify. The course has the following question:
What do you think is the output of the following piece of code?
((x = 2#1101 & 2#110))
((y = ~x))
print - $y
The answer given is 11, as in decimal eleven or 2#1011.
From what I understand I think the answer should be -5 as in -2#101.
|
You are correct:
$ ((x = 2#1101 & 2#110))
$ ((y = ~x))
$ print - $y
-5
$
|