Hi. I writed a simple calculator and i dont know why when i type q, the loop doesnt end. Also when i write an unknown operator, the error message doesnt show up. Any ideas how to fix this?
Using break there doesn't do anything. Break is used for switch statements and not if statements. Replace it with return 0; Secondly, you need to learn to properly indent your code because it's harder to understand when it's indented like you have it now.
@Peter87 it is very strange indeed... is that it, that i have to put the operator after the two numbers? because as you can see up there, i have made the operator the first one to be entered...
@Peter87 alright, i got that about the operator, but it still doesnt quit when i input q... i shall rewrite it on a new file and recompile it. Maybe will it work?