Home > Net >  VS2019 write simple arithmetic calculator error, bosses more o o (0 man 0)
VS2019 write simple arithmetic calculator error, bosses more o o (0 man 0)

Time:10-26

 # include 
Int main ()
{
Int num1, num2;
char ch;
Float the result;
Printf (" do input: ");

Scanf_s (" % d % d % c ", & amp; Num1, & amp; Ch, & amp; Num2);

The switch (ch)
{
A case of '+' : num1 + num2; break;
Case '-' : the result=(float) num1 - num2; break;
Case: '*' result=(float) num1 * num2; break;
Case '/' :
If (num2==0)
{
Printf (" you're wrong ");
break;
}
The else
{
Result=num1/num2;
break;
}


}




Printf (" the result is: % 2 f \ n ", result);



return 0;
}
  • Related