Home > Back-end >  C simple calculator the error in where? Can someone help me have a look?
C simple calculator the error in where? Can someone help me have a look?

Time:11-10

#include
using namespace std;

Int main ()
{
Int a, b, d=0;
char c;
Cin> A> b> c;
The switch (c) {
A case of '+' : d=a + b; break;
Case '-' : d=a - b; break;
Case '*' : d=a * b; break;
Case: '/' d=a/b; break;
}
Coutreturn 0;
}

CodePudding user response:

Take title to the requirement of output format into consideration, also just about, such as case '/' d=a/b after check before b is zero, add a default after the case statement
  • Related