Bitwise Operators Questions And Answers.
Exercise ::
Bitwise Operators
1. | In which numbering system can the binary number 1011011111000101 be easily converted to? |
| |
| A. | Decimal system |
| B. | Hexadecimal system |
| C. | Octal system |
| D. | No need to convert |
|
|
| Answer: Option B |
|
|
| Explanation: |
|
Hexadecimal system is better, because each 4-digit binary represents one Hexadecimal digit. |
| See More Information |
|
|
|
Tutorial Link: |
Published by:Michael Daani
2. | Which bitwise operator is suitable for turning off a particular bit in a number? |
| |
| A. | && operator |
| B. | & operator |
| C. | || operator |
| D. | ! operator |
|
|
Published by:Michael Daani
3. | Which bitwise operator is suitable for turning on a particular bit in a number? |
| |
| A. | && operator |
| B. | & operator |
| C. | || operator |
| D. | | operator |
|
|
Published by:Michael Daani
4. | Which bitwise operator is suitable for checking whether a particular bit is on or off? |
| |
| A. | && operator |
| B. | & operator |
| C. | || operator |
| D. | ! operator |
|
|
Published by:Michael Daani
5. | Assuming, integer is 2 byte, What will be the output of the program? |
|
#include<stdio.h>
int main()
{
printf("%x\n", -1>>1);
return 0;
}
|
| A. | ffff |
| B. | 0000 |
| C. | ffdf |
| D. | ddfd |
|
|
Published by:Michael Daani