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
21. Which technique helps reduce floating-point errors in summation operations?
- Bubble sort algorithm
- Kahan summation algorithm
- Binary search
- Quick sort algorithm
22. What is the "unit in the last place" (ULP) error?
- Error in the first digit
- Spacing between floating-point numbers
- Memory allocation error
- Compiler optimization issue
23. Which of these values represents positive infinity in IEEE 754?
- 0
- 1
- Maximum finite value
- A special bit pattern
24. What is "gradual underflow" in floating-point systems?
- Immediate zero assignment for small numbers
- Smooth transition using denormalized numbers
- Rounding all small numbers to nearest integer
- Using integers instead of floats
25. Which operation is generally safe from catastrophic cancellation?
- a - b where a ≈ b
- a + b where a ≈ -b
- a * b where a ≈ b
- (a + b) - a where b is small
26. What does the "sticky bit" help with in floating-point rounding?
- Detecting overflow
- Improving rounding accuracy
- Speeding up division
- Handling NaN values
27. In floating-point comparison, why should direct equality checks be avoided?
- They are too slow
- They consume more memory
- Rounding errors make exact equality unlikely
- They cause compiler errors
28. What is the "hidden bit" in IEEE 754 normalized numbers?
- A bit that is always zero
- An implied leading 1 in mantissa
- The sign bit
- The least significant bit