I'm extremely new to C++, I was following a tutorial and wanted to go a bit off what the course said, I attempted to make a basic calculator that instead of just being able to add could subtract, divide and multiply but it still seems to only be able to add, why is this?
int num1, num2;
double sum;
int addType;
cout << "Type a number: ";
cin >> num1;
cout << "Type a second number: ";
cin >> num2;
cout << "Do you want to 1. add, 2. subtract, 3. divide or 4. multiply: ";
cin >> addType;
if (int addType = 1) {
sum = num1 + num2;
}
else if (int addType = 2) {
sum = num1 - num2;
}
else if (int addType = 3) {
sum = num1 / num2;
}
else if (int addType = 4) {
sum = num1 * num2;
}
cout << "Your total is: " << sum;
}