Witam, mam sobie taki prosty programik dodający 2 macierze, wszystko działa jednak chciałbym żeby mi ładnie wyłapywał wyjątki. Nie do końca wiem gdzie w tym programie dać try { } żeby potem wyłapać to poprzez catch { }. Jakieś podpowiedzi? :) 
  
 
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            int k, l, m, n;            Random rnd = new Random();            Console.WriteLine("Podaj wymiary tablicy A: ");            Console.Write("m = ");            k = Convert.ToInt32(Console.ReadLine());            Console.Write("n = ");            l = Convert.ToInt32(Console.ReadLine());            double[,] m1 = new double[k, l];            Console.WriteLine("\nPodaj wymiary tablicy B ");            Console.Write("m = ");            m = Convert.ToInt32(Console.ReadLine());            Console.Write("n = ");            n = Convert.ToInt32(Console.ReadLine());            double[,] m2 = new double[m, n];            Console.WriteLine("\nTablica A:");            for (int i = 0; i < m1.GetLength(0); i++)            {                for (int j = 0; j < m1.GetLength(1); j++)                {                    m1[i, j] = rnd.NextDouble();                    Console.Write("{0:N2} ", m1[i, j]);                }                Console.WriteLine();            }            Console.WriteLine("\nTablica B:");            for (int i = 0; i < m2.GetLength(0); i++)            {                for (int j = 0; j < m2.GetLength(1); j++)                {                    m2[i, j] = rnd.NextDouble();                    Console.Write("{0:N2} ", m2[i, j]);                }                Console.WriteLine();            }            Console.WriteLine("\nTablica A+B:");            for (int i = 0; i < m1.GetLength(0); i++)            {                for (int j = 0; j < m1.GetLength(1); j++)                {                    Console.Write("{0:N2} ", dodawanie(m1, m2)[i, j]);                }                Console.WriteLine();            }            Console.ReadLine();        }        static double[,] dodawanie(double[,] a, double[,] b)        {            double[,] c = new double[a.GetLength(0), a.GetLength(1)];            if ((a.GetLength(0) != b.GetLength(0)) || (a.GetLength(1) != b.GetLength(1)))            {                throw new IndexOutOfRangeException("Macierze maja rozne wymiary!");            }            for (int i = 0; i < c.GetLength(0); i++)            {                for (int j = 0; j < c.GetLength(1); j++)                {                    c[i, j] = a[i, j] + b[i, j];                }            }            return c;        }    }}