Question #163980

Consider the following variables: 

int flags = 0xB2; 

int mask; 

What of the following are the correct statements if bit 6 of flags is to be toggled?

mask=0xBF;

flags = flags ^ mask;mask=0x40;

flags = flags ^ mask;mask=0xBF;

flags = flags | mask;mask=0x40;

flags = flags | mask;


Expert's answer

mask=0xBF;

flags = flags ^ mask;mask=0x40



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS