Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Suppose n is a variable of the type Byte and we wish, to check whether its fourth bit (from right) is ON or OFF. Which of the following statements will do this correctly? ?->(Show Answer!)
1. Suppose n is a variable of the type Byte and we wish, to check whether its fourth bit (from right) is ON or OFF. Which of the following statements will do this correctly?
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.04 pm
byte myByte = 153; // In Binary = 10011001 byte n = 8; // In Binary = 00001000 (Here 1 is the 4th bit from right) Now perform logical AND operation (n & myByte) 10011001 00001000 --------- 00001000 Here result is other than 0, so evaluated to True. --------- If the result is true, then we can understand that 4th bit is ON of the given data myByte.