Operators and Expressions

Operators

Operators are those symbols that perform some specific task. Like, when we add two numbers we generally use '+' sign. In programming also, to perform some specific task, compiler has assigned some specific symbols. These symbols are called operators.

Operand

The data items that operators act upon are called operands. Some operators require one operand to act upon, whereas some require more than one.

Expression

An expression is a combination of operands and operators written according to the syntax of language.

Operands, Operators and Expression Example

Operands, Operators and Expression Example
Figure: Operands, Operators and Expression Example

Since some operators require one operand, whereas some require more than one. Depending upon the number of operands required by the operators, we can broadly divide operators into three distinct categories.

  1. Unary Operators
  2. Binary Operators
  3. Ternary Operators