C- Floating Point Issues MCQ Questions and Answers
Handling floating-point numbers in C can be tricky due to precision limits, rounding errors, and data representation issues. This section on C Floating Point Issues questions with answers is designed to help you master these concepts effectively. In interviews and placement tests by Infosys, TCS, and Wipro, such questions are commonly asked to test your understanding of floating-point arithmetic and memory storage. Practicing C programming MCQs on this topic will improve your accuracy in calculations and code debugging. Each question includes detailed reasoning to clarify why floating-point comparisons or conversions behave unexpectedly. Strengthen your programming foundation and get ready for technical assessments with this comprehensive guide.
C- Floating Point Issues MCQ
11. What is the term for the error that occurs when a number cannot be represented exactly in floating-point format?
- Syntax error
- Rounding error
- Compilation error
- Logical error
12. In IEEE 754 single-precision floating-point, how many bits are allocated for the exponent?
- 11 bits
- 8 bits
- 23 bits
- 16 bits
13. Which of the following operations is most likely to amplify floating-point errors?
- Addition
- Multiplication
- Subtraction of nearly equal numbers
- Division by powers of 2
14. What is "catastrophic cancellation" in floating-point arithmetic?
- Division by zero
- Overflow beyond maximum value
- Loss of significant digits in subtraction
- Infinite loops in calculation
15. Which decimal value is most likely to cause representation issues in binary floating-point?
- 0.5
- 0.25
- 0.1
- 0.75
16. What is the purpose of the "guard digit" in floating-point operations?
- Prevent division by zero
- Detect overflow conditions
- Provide extra precision in intermediate calculations
- Speed up multiplication operations
17. In IEEE 754 double-precision, how many bits are used for the mantissa?
- 23 bits
- 52 bits
- 11 bits
- 64 bits
18. What is "denormalized numbers" in IEEE 754 standard?
- Numbers larger than maximum representable value
- Numbers with more precision than normal
- Numbers smaller than smallest normalized number
- Complex numbers with imaginary parts
19. Which of these comparisons might give unexpected results due to floating-point precision?
- 1.5 == 1.5
- 0.1 + 0.2 == 0.3
- 2.0 == 2.0
- 0.0 == 0.0
20. What is "NaN" in floating-point arithmetic?
- Not a Number
- Negative Absolute Number
- Normalized Arithmetic Value
- Negative Approximation Null