+ 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?

7th Feb 2017, 12:56 AM
Muhammad Ahsan
Muhammad Ahsan - avatar
3 odpowiedzi
+ 6
"+" is an arithmetics operator. "=" is an assignment operator. By operator precedence, arithmetic operators are proceed first before assignment unless specified otherwise.
7th Feb 2017, 1:27 AM
Wen Qin
Wen Qin - avatar
+ 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.
7th Feb 2017, 1:09 AM
Nelson Urbina
Nelson Urbina - avatar
+ 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
11th Feb 2017, 8:12 AM
Kommoju Sunil Kumar
Kommoju Sunil Kumar - avatar