B

Babita • 7.70K Points
Tutor III

Q. The generalised syntax for a real number representation is

  • (A) [digits][.digits][(E|e)[(+|-)]digits]
  • (B) [digits][+digits][(E|e)[(+|-)]digits]
  • (C) [digits][(E|e)[(+|-)]digits]
  • (D) [.digits][digits][(E|e)[(+|-)]digits]
  • Correct Answer - Option(A)
  • Views: 169
  • Filed under category JavaScript

Explanation by: Official MCQ Buddy

A real number (floating-point number) in most programming languages follows this general format:

  1. [digits] → Represents the integer part (optional).
  2. [.digits] → Represents the fractional part (optional).
  3. [(E|e)[(+|-)]digits] → Represents the exponent notation (optional).

This allows real numbers to be written in different forms, such as:

  • 123.456 (Normal decimal representation)
  • 0.789 (Starts with a decimal point)
  • 123E4 (Scientific notation, equivalent to 123 × 10⁴)
  • 3.14e-2 (Equivalent to 3.14 × 10⁻²)

Thus, option (A) [digits][.digits][(E|e)[(+|-)]digits] correctly represents the general syntax for real number representation.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics