1. ## Arithmetic Help

Hey, how do I assign a math problem to a variable? Example:

x + y > answer (variable)

I want to do something of that formula, instead of:

cout << "x + y";

2. To assign something the equation goes to the right:

variable = x + y

However, you've got two completely different things going on in your question:

x + y > answer (variable)
would mean that x + y is greater than answer

cout << "x + y";
would give you the output:

Code:
`x + y`

3. I don't know what you mean by assigning a math problem to a variable. You can assign an expression to a variable, for example:

If you want to display the expression "x + y", you assign "x + y" to a string variable. I'm not sure if I've missed your question.

4. Originally Posted by BuzzBuzz
To assign something the equation goes to the right:

variable = x + y

However, you've got two completely different things going on in your question:

would mean that x + y is greater than answer

would give you the output:

Code:
`x + y`
Thanks, I got it now. I used > more as an arrow to go into the variable, but I understood how it could be mixed up. Thanks again.