Difficulty: Easy
Correct Answer: double
Explanation:
Introduction / Context:Literal types influence overload resolution, precision, and performance. In both C and C++, an unsuffixed real literal like 3.5 is assigned a default floating type unless a suffix changes it. Recognizing this default helps you pick correct function overloads and avoid unintentional narrowing conversions.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Solution:
Identify the absence of a suffix → default applies.Default floating literal type → double.Therefore, answer: 'double'.Verification / Alternative check:
Use sizeof(3.5) versus sizeof(3.5f) in C++: commonly 8 bytes vs 4 bytes on typical platforms, confirming different default types.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
double
Discussion & Comments