0

I want to see the exaption at the console , i run this progarm :

  class Program
    {
        static void Main(string[] args)
        {
            int[] arr = { 1, 3, 5, 7, 9 };
            try
            {
                
                Console.WriteLine("Enter a index : ");
                int index = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("The number at index "+index+" is "+arr[index]);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Some error : "+ex.Message);
            }
        }
    }
}

And i get this exaption :

enter image description here

Pluto
  • 853
  • 1
  • 8
  • 28

0 Answers0