Q. A hexadecimal literal begins with
β
Correct Answer: (D)
Both 0x and 0X
Explanation:
The correct answer is:
(D) Both 0x and 0X
Explanation:
In most programming languages (such as C, C++, Java, JavaScript, and Python), a hexadecimal literal starts with either 0x or 0X. Both notations are valid and indicate that the number is in hexadecimal (base 16) format.
Examples:
- 0x1A3F (Hexadecimal representation of 6719 in decimal)
- 0XFF (Hexadecimal representation of 255 in decimal)
Thus, the correct answer is (D) Both 0x and 0X.