I was making a simple calculator in C++. However the program does not completely function the way it should. When run, the trig if statement executes fine, however, the basic ar
This line is wrong.
if(function == "sin" || "cos" || "tan")
It should be
if((function == "sin") || (function == "cos") || (function == "tan"))
Note that the check is actually meaningless because you already check for them each individually. You could tidy this up by doing this in a if
, else if
, else
chain.