# Problem for greenhorn

```#include <iostream> #include <cmath> using namespace std; int main() {         int num1, num2, answer;         char operand;         cout << "Please enter a number: ";         cin >> num1;         cout << "Now enter an operand: ";         cin >> operand;         cout << "Now enter a second number: ";         cin >> num2;         if (operand == '+')                 answer = num1 + num2;                 cout << "The answer is " << num1 << "+" << num2 << "=" << answer << endl;         if (operand == '-')                 answer = num1 - num2;                 cout << "The answer is " << num1 << "-" << num2 << "=" << answer << endl;         if (operand == '*')                 answer = num1 * num2;                 cout << "The answer is " << num1 << "*" << num2 << "=" << answer << endl;         if (operand == '/')                 answer = num1 / num2;                 cout << "The answer is " << num1 << "/" << num2 << "=" << answer << endl;         if (operand == '%')                 answer = num1 % num2;                 cout << "The answer is " << num1 << "%" << num2 << "=" << answer << endl;         else                  cout << "An invalid operator was entered" << endl;         return 0; }```