A

Admin • 828.03K Points
Coach

Q. What will happen when this code is executed?

Code:
try
{
int x = 10 / 0;
}
catch(Exception ex)
{
Console.WriteLine("Error");
}
  • (A) Compilation error
  • (B) Runtime crash
  • (C) Error
  • (D) No output

Explanation by: Admin
Division by zero throws an exception which is caught.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.