DivideByZeroException örnek uygulama
try
{
int sayi1 = Convert.ToInt32(textBox1.Text);
int sayi2 = Convert.ToInt32(textBox2.Text);
int sonuc = sayi1 / sayi2;
textBox3.Text = sonuc.ToString();
}
catch (FormatException)
{
MessageBox.Show(“Lütfen alanlara sadece sayı yazınız”);
}
catch (DivideByZeroException)
{
MessageBox.Show(“Lütfen sıfıra bölme işlemi yapmayınız”);
}
