Sumali sa IDNStudy.com at makuha ang mabilis at kaugnay na mga sagot. Ang aming platform ay idinisenyo upang magbigay ng mabilis at eksaktong sagot sa lahat ng iyong mga tanong.
Answer: 0
int Result = a & b;
& means binary AND
Let as use this table:
1 & 1 = 1
0 & 0 = 0
0 & 1 = 0
1 & 0 = 0
Now convert a and b to binary.
2 & 5 = ?
0010 & 0101 = _ _ _ _
Solve:
0 & 0 = 0
0010 & 0101 = 0 _ _ _
0 & 1 = 0
0010 & 0101 = 0 0_ _
1 & 0= 0
0010 & 0101 = 0 0 0 _
0 & 1 =1
0010 & 0101 = 0 0 0 0
Now convert to decimal:
0 * 2^4 + 0 * 2^2 + 0 * 2^1 + 0 * 2^0 = 0
Answer:
int Result = a & b;
Result == 0