Write your question here.
Why isn't my code going through any other of the if else, it only does if then cuts 0ff and gives me the answer for that
[int main()
{
int num1;
char op;
int num2;
cout << "Please enter first number: \n";
cin >> num1;
cout << "Please enter operator: \n";
cin >> op;
cout << "Please enter second number: \n";
cin >> num2;
if(op = '+'){
cout << num1 + num2;
} else if (op = '-'){
cout << num1 - num2;
} else if (op = '*'){
cout << num1 * num2;
} else if(op = '/'){
cout << num1 / num2;
} else{
cout << " \nError, wrong operator or numbers, please enter *, /, -, + thank you \n ";
}
return 0;
}]
Put the code you need help with here.
[
if(op = '+'){
cout << num1 + num2;
} else if (op = '-'){
cout << num1 - num2;
} else if (op = '*'){
cout << num1 * num2;
} else if(op = '/'){
cout << num1 / num2;
} else{]