πŸ“Š JavaScript
Q. A hexadecimal literal begins with
  • (A) 00
  • (B) 0x
  • (C) 0X
  • (D) Both 0x and 0X
πŸ’¬ Discuss
βœ… 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.

Explanation by: Official MCQ Buddy

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
207
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
82%
Success Rate