I have a bug in a simple calculator program. C++
I can't figure out what is going on in this condition of my while loop. I'm trying to say in my condition; while the variable op does not equal to char +, -, /, or *, then continue through the if statements. //This is a calculator app that adds, subtracts, multiplies, or divides two numbers. #include <iostream> using namespace std; int main() { //Sets up variables. num1 and num2 are inputs by user, result is the calculation of the two. Op is a char that the user inputs, either -, +, /, or *. double num1; double num2; double result; char op; //Sets up the instructions and inputs all information from user. cout << "Welcome to my calculator." << endl; cout << "Enter your first number: "; cin >> num1; cout << "The operator can be a; +, -, /, or *" << endl; cout << "Enter the operator: "; cin >> op; cout << "Enter the second number: "; cin >> num2; //Calculates the inputs by the user or informs them that there was an error. ----->while (op != '+' || '-' || '/' || '*') {<--------------------------------------------------------- cout << "The operator can be a; +, -, /, or *" << endl; cout << "Enter the operator: "; cin >> op; if (op == '+') { result = num1 + num2; } else if (op == '-') { result = num1 - num2; } else if (op == '/') { result = num1 / num2; } else if (op == '*') { result = num1 * num2; } else { cout << "Invalid operator." << endl; } } //Prints the calculation on the screen and ends the function. cout << "And the total is:" << endl; cout << result; return 0; }