The code has very limited scope so unless you want to extend it to a full floating point expression parser (which is quite a complex beast) there's not a lot to say. You asked for comments, but leading to what? Do you just want to improve it within the limited scope of taking two integers and an operator? If so then the only thing you can really add is more operators. If you want to extend it to a full expression evaluator including order of precedence rules (e.g. 2+3*5=17, not 25) then this is typically done either using a pair of stacks, one for operators and one for numbers/variables, or by converting the expression to reverse polish notation (e.g. 2 3 5 * + gives the result 17). An RPN expression evaluator is a lot simpler to do and could be a good first step.