Numerical Representation

1. What is the binary representation of the decimal number 31?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. Which of the following C statements sets the 0th bit of n to 1?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. What is the result of left shifting the binary number 101 by 2 positions?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. Which of the following is the correct way to check if the 3rd bit (from right, 0-indexed) of n is set in C?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

5. What is the minimum number of bits required to represent the decimal number 1023 in binary?

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

6. Which of the following C statements clears the 2nd bit (from right, 0-indexed) of n?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

7. Which of the following is the binary representation of the decimal number 512?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

8. Which of the following best describes the effect of the XOR (^) operator in binary arithmetic?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

9. What is the result of 14 ^ 9 in C? (where ^ is bitwise XOR)

Explanation

Explanation

Explanation

Explanation

Explanation

10. Which of the following best describes the purpose of using binary representation in computers?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation