This is the code:
class Program
{
static void Main(string[] args)
{
double varrr = Divide(10, 0);
}
static double Divide(double a, d
MSDN explains that DivideByZeroException is only thrown "[when] trying to divide an integer or decimal number by zero", whereas
floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.
Use Double.IsInfinity() instead:
if (double.IsInfinity(c))
{
Console.WriteLine("Division by zero not allowed");
return 0;
}