MCQOPTIONS
Saved Bookmarks
| 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? |
| A. | if ((n&16) == 16) Console.WriteLine("Fourth bit is ON"); |
| B. | if ((n&8) == 8) Console.WriteLine("Fourth bit is ON"); |
| C. | if ((n ! 8) == 8) Console.WriteLine("Fourth bit is ON"); |
| D. | if ((n ^ 8) == 8) Console.WriteLine("Fourth bit is ON"); |
| Answer» C. if ((n ! 8) == 8) Console.WriteLine("Fourth bit is ON"); | |