Home / MCQ Bank / Computer
Computer Exception Handling In C Sharp

What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { int i; int v = 40; int[] x = new int[5]; try { Console.WriteLine(" Enter the number: "); index = Convert.ToInt32(Console.ReadLine()); x[index] = v; } catch(Exception e) { Console.WriteLine("Exception occurred"); } Console.WriteLine("Program executed"); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Exception occurred Program executed

Related Computer Questions

Which of the following is the slowest in accessing data? “MAN” stands for_______________? Identify false statement What is the access specifier that allows members to be accessed from outside the class in C++? Which one of the following is an example of Operating System?