I made a calculator that allows you to do different operation based off of what number you type in for the first one, but its only doing addition, an someone help me.
[code]
int main()
{
std::string name;
int x;
int y;
int z;
std::cout << "What is your name? ";
getline (std::cin, name);
std::cout << "Thanks for using my calculator " << name << "!";
std::cout << " What's the operation? ";
std::cin >> z;
std::cout << " What's the first number? ";
std::cin >> y;
std::cout << "What's the second number? ";
std::cin >> x;
if (z = 1){
std::cout << x << " + " << y << " = ";
std::cout << x + y;
}else if (z = 3){
std::cout << x << " x " << y << " = ";
std::cout << x * y;
}else if (z = 2){
std::cout << x << " - " << y << " = ";
std::cout << x - y;
}else if (z = 4){
std::cout << x / y;
std::cout << x << " / " << y << " = ";
}else
std::cout << "Sorry, this calculator does not understand that operation, please pick a number 1 to 4";
}