+ 2
In " x = 3 + 6" , Is "=" sign is an operator or not? If it is an operator then what we'll call "x" ? An operand or a variable?
3 Answers
+ 6
"+" is an arithmetics operator. "=" is an assignment operator. By operator precedence, arithmetic operators are proceed first before assignment unless specified otherwise.
+ 3
Technically speaking, "=" is an operator (the assignment operator) and the variable "x" is an operand (the left operand) of the assignment operator in the " x = 3 + 6" expression, just as "3" is the left operand of the "+" operator in the same expression.
+ 2
For an "=" assignment operator, left side operand should be definitely a variable and right side operand can be a variable or a constant.
So, In this statement, "x " is an operand for the "=" assignment operator which should be obviously a variable.
So here x is both operand and variable