LogiQuest
Back to Exception Handling
13

What is the output of the following program?

Console.WriteLine(Check(-1));
static string Check(int v)
{
    try { if (v < 0) throw new ArgumentException(); return "ok"; }
    catch (ArgumentException) { return "neg"; }
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.