my if statement within my switch statement does not work correct within my calculator. need help fixing the divide by 0 error

后端 未结 1 880
星月不相逢
星月不相逢 2021-01-29 06:58

i created a basic calculator, but with division i coded it, that when i divide by zero it will give the error to the user in the 2nd textbox, but now even if i divide by 3 or an

相关标签:
1条回答
  • 2021-01-29 07:34

    On the first line of aequal_Click(object sender, RoutedEventArgs e) replace

    Double num02 = 0;
    

    by

    Double num02 = Convert.ToDouble(textbox1.Text);
    
    0 讨论(0)
提交回复
热议问题