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?
1.if ((n&16) == 16) Console.WriteLine("Fourth bit is ON");
2.if ((n&8) == 8) Console.WriteLine("Fourth bit is ON");
3.if ((n ! 8) == 8) Console.WriteLine("Fourth bit is ON");
4.if ((n ^ 8) == 8) Console.WriteLine("Fourth bit is ON");
Posted Date:-2021-02-25 10:28:15