please explain the algorithm in my code
What is problem in my submission
your Mistakes:
-
you are not taking next operator(i.e. ch) each time
cin>>ch;
-
you are not calculating output for ‘%’ operator;
-
other operators such as special cases(i.e. $, #,;,…) you have to providing output as:
"Invalid operation. Try again."
-
whenever you receive the operator ‘x’ or ‘X’ your calculator stop execution.
Modified Code :
i hope this help, if you have further doubt then feel free to ask;