how to except a specific type of error with try catch c#
using System;
public class Program
{
public static void Main()
{
int x = 10 ;
int i = 0 ;
try{
int result = x/i ;
Console.WriteLine("the result is {0}",result) ;
}
catch(DivideByZeroException){
Console.WriteLine("You are triying to divide by zero") ;
}
}
}