Difficulty: Easy
Correct Answer: 1.2e2.0
Explanation:
Introduction / Context:
This question checks the rules for writing floating-point constants in C using scientific notation (exponent form). The exponent part must be an integer (no decimal point), and there must be no spaces within the literal.
Given Data / Assumptions:
Concept / Approach:
We compare each candidate with the lexical rules for C floating constants. Any deviation (for example, a non-integer exponent like '2.0') makes the token invalid. All valid forms must have an exponent consisting solely of optional sign followed by one or more decimal digits.
Step-by-Step Solution:
Verification / Alternative check:
The C standard grammar for floating constants requires the exponent part to be an optionally signed sequence of digits; a decimal point in the exponent is illegal.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
int
range of −32768 to +32767)?
Discussion & Comments