Question:

Which of the following is invalid floating point constant?

Show Hint

In exponential notation, the exponent must always be an integer. Examples: \(2.5E3\), \(1.4E-2\), \(5e+7\) are valid, but \(2.5E3.5\) is invalid.
Updated On: Jun 25, 2026
  • \(0.65e4\)
  • \(1.5e+5\)
  • \(18E+3.5\)
  • \(-1.2E-1\)
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept: In C programming, a floating-point constant may be written in exponential notation as: \[ m \times 10^e \] where:
• \(m\) is the mantissa.
• \(e\) is an integer exponent.
• The exponent is written after \(E\) or \(e\). General format: \[ \text{mantissa}E\text{exponent} \] The exponent must always be an integer value.

Step 1:
Check Option (A).
\[ 0.65e4 \] means \[ 0.65\times10^4 \] The exponent \(4\) is an integer. Hence this is valid.

Step 2:
Check Option (B).
\[ 1.5e+5 \] means \[ 1.5\times10^5 \] Again the exponent is an integer. Hence this is valid.

Step 3:
Check Option (C).
\[ 18E+3.5 \] Here the exponent is \[ 3.5 \] which is not an integer. Floating-point constants do not allow fractional exponents. Therefore this representation is invalid.

Step 4:
Check Option (D).
\[ -1.2E-1 \] means \[ -1.2\times10^{-1} \] which is perfectly valid.

Step 5:
Write the final answer.
Hence the invalid floating-point constant is \[ \boxed{18E+3.5} \] Therefore option (C) is correct.
Was this answer helpful?
0
0