Hello there, I'm new to C++ and I was trying to do kind of a calculator, with simple operations like subtracting two numbers. I read most of the guide, but I can't seem to find out, why the result shows "X". This is the code I made:
Thanks I've done what you suggested, but I still can't see the result of the operation (now for some reason I get a smiley...not joking).Is it the compiler maybe? I use Code Blocks.
I have played a bit with the program (using several numbers) and I found out that the dividing part had a problem. If I tried to divide 3 by 2 it results 1, instead of 1.5 (and 5/2 = 2). I tried making operation a double and a long to see if it works but it doesn't.