ITHelpself / CSharp-team-lttq

0 stars 0 forks source link

5. throw/exception #5

Open nhokhacam1 opened 3 years ago

ITHelpself commented 3 years ago

        static double thuong(int a, int b)
        {
            if(b == 0)
            {
                throw new Exception("Loi chia cho 0");
            }
            return (double)a / b;
        }