CSharp - What is the output: Dividing by a zero valued variable?

Question

What is the output of the following code?

using System;
class MainClass
{
   public static void Main(string[] args)
   {
         int b = 0;
         int c = 5 / b;
         Console.WriteLine(c);

   }
}


Click to view the answer

int c = 5 / b;      // throws DivideByZeroException

Note

Dividing by a variable whose value is zero generates a runtime error DivideByZeroException.