C# Tricky Question: Floating-Point Behavior and NaN

🧠 **C# Tricky Basic Question – Day 4** Let’s test your understanding of **floating-point behavior in C#**. ```csharp float f = 0f / 0f; Console.WriteLine(float.IsNaN(f)); ``` 💡 **What will be the output?** A) True B) False C) Compile Error D) Runtime Error Many developers expect a **runtime error** when dividing by zero… but floating-point numbers behave differently in C#. ⚡ Understanding concepts like **NaN (Not a Number)** is important when working with **numeric computations, data processing, and scientific calculations**. 👇 **Comment your answer before running the code.** I'll share the explanation in the comments. Follow for more **daily C# tricky questions** that sharpen your programming fundamentals. #CSharp #DotNet #Programming #CodingInterview #DeveloperCommunity #SoftwareDevelopment #Codi

  • graphical user interface

To view or add a comment, sign in

Explore content categories