Ok, basically I am making a console arithmetic calculator just for learning, I am new. I can't seem to figure out why no matter what method I use, it adds it even if I chose to multiply, please look at the code and tell me how to fix it, or help me in any way you can, all help is appreciated. Thanks in advance.
It's your usage of ||. I believe (could be wrong here mind) that you have to be explicit each time you use || so you would have to do method != add || method != sub, etc...
But you don't need the != part either.
Just use
else if(method == sub ) instead (for example)
BUT!
I'd like you to tell me what sub,add, etc actually are? They haven't been set to anything so the statement if (method == add) for example doesn't actually mean anything.
You could assign add,sub, etc values such as 1,2,3 and use
if (method == 1) for example.
Originally I had it as else if(method == sub ) but I thought maybe it'd fix the program, I don't really understand alot of C++. Just basic math, but how do I make it so when I enter a method when it asks for (e.g. add, sub, mul, divide, mod) that it returns the two numbers either added, multiplied etc depending on what method was entered by the user?