Thursday, March 4, 2010

Bitwise with AND & OR

Do you remember bitwise with AND and OR?
DECLARE @a INT,@b INT,@c INT,@d INT
SELECT @a = 2, @b = 3, @c = 5
SET @d = (@a & @b)| @c
SELECT @d

A. 2
B. 3
C. 5
D. 7
E. 8
F. 10

Answer:[D]
Highlight to find out the answer.

Explanation:
@a = 010
@b = 011
-----------
@a&@b = 010
@c = 101
-----------
@d = 111

No comments:

Post a Comment