1. Which of the following statements are correct about the program?

Screenshot 1

A. It prints all even bits from num
B. It prints all odd bits from num
C. It prints binary equivalent num
D. Error


Correct Answer: C. It prints binary equivalent num

2. Which of the following statements are correct about the program?

Screenshot 2

A. It counts the number of bits that are ON (1) in the number num.
B. It counts the number of bits that are OFF (0) in the number num.
C. It sets all bits in the number num to 1
D. Error


Correct Answer: A. It counts the number of bits that are ON (1) in the number num.

3. Which of the following statements are correct about the program?

Screenshot 3

A. It converts a number to a given base.
B. It converts a number to its equivalent binary.
C. It converts a number to its equivalent hexadecimal.
D. It converts a number to its equivalent octal.


Correct Answer: A. It converts a number to a given base.

4. Which of the following statements are correct about the program?

Screenshot 4

A. It will put OFF all bits that are ON in the number n
B. It will test whether the individual bits of n are ON or OFF
C. It will put ON all bits that are OFF in the number n
D. It will report compilation errors in the if statement.


Correct Answer: B. It will test whether the individual bits of n are ON or OFF

 

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

five × 3 =