C#中如何跳出if判断语句?
if(除数为零)
{
不执行后续操作,退回主程序
}
else
{
计算并返回两数之商
}
// Quotient calculates the divisions of three int's
public static int Quotient(int a, int b)
{
int quotientTotal;
if (b == 0)
{
Console.WriteLine("Error! The divisor can't be zero!");
break; (?C#语言如何终止Quotient函数,返回调用它的Main函数中)
}
else
{
quotientTotal = a / b;
return quotientTotal;
}
}