my if statement within my switch statement does not work correct within my calculator. need help fixing the divide by 0 error(我的 switch 语句中的 if 语句在我的计算器中无法正常工作.需要帮助修复除以 0 的错误)
问题描述
我创建了一个基本的计算器,但是我对它进行了除法编码,当我除以零时,它会在第二个文本框中向用户显示错误,但现在即使我除以 3 或任何其他不是0,错误一直出现在我的第二个文本框中.
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 any other number that is not 0, the error keeps appearing in my second textbox.
推荐答案
在aequal_Click(object sender, RoutedEventArgs e)的第一行替换
On the first line of aequal_Click(object sender, RoutedEventArgs e) replace
由
这篇关于我的 switch 语句中的 if 语句在我的计算器中无法正常工作.需要帮助修复除以 0 的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!