Exception handling
Exception is defined as an event that occurs during the execution of a program that is unexpected by the program code. The actions to be performed in case of occurrence of an exception is not known to the program. In such a case, we create an exception object and call the exception handler code. The execution of an exception handler so that the program code does not crash is called Exception handling. Exception handling is important because it gracefully handles an unwanted event, an exception so that the program code still makes sense to the user.
We already studied what is Run time error, In simple terms Exception handling is something which is used to hangle the run time errors. Because if there is any compile time error system will not even compile the code whereas programmer don't have any control over run time errors because run time error is caused due to improper user inputs.
CODE
EG 1 . Getting number from user
static void Main(string[] args) {
    try {
        Console.Write("Enter Number : ");
        int num = Convert.ToInt32(Console.ReadLine());
    }
    catch {
        Console.WriteLine("Invalid Entry");
    }
}
EG 2 . Getting number from user printing exact Exception thrown by system
static void Main(string[] args) {
    try {
        Console.Write("Enter Number : ");
        int num = Convert.ToInt32(Console.ReadLine());
    }
    catch (Exception e){
        Console.WriteLine(e.Message);
    }
}
(Click Here, For more exercises)