|
-
Apr 14th, 2001, 08:12 PM
#2
Thread Starter
Dazed Member
ok i broke it down.....
values represented as short types:
int n = 7;
n<<=3;
00000000 00000111 = 7
seven shifted 3 = 00000000 00111000 = 56
n = n & n + 1 | n + 2 ^ n + 3;
n = 56 & 56 + 1 | 56 + 2 ^ 56 + 3
n = 56 + 57 + 58 + 3
n = 174;
n >>= 2;
00000000 10101110 = 174
174 shifted 2 = 00000000 11101011 = 235
i get 235 as the answer but the book say 14
is the answer. Any one know why that is so?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|